Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata.accessors.objects

public Class MetadataMethod

extends MetadataAnnotatedElement
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .List, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.internal.helper.Helper, org.eclipse.persistence.internal.jpa.metadata.MetadataLogger, org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor

INTERNAL: An object to hold onto a valid JPA decorated method.
Author
Guy Pelletier
Since
TopLink 10.1.3/EJB 3.0 Preview

Field Summary

Modifier and TypeField and Description
protected MetadataClass
m_metadataClass

Class that the method is defined in.

protected MetadataMethod
m_next

Used to store multiple methods with the same name in a class.

protected List<String>
m_parameters

List of class names of method parameters.

protected String
m_returnType

Class name of method return type.

protected MetadataMethod
m_setMethod

Corresponding set method, if the method is an accessor get method.

Inherited from org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement:
DEFAULT_RAW_CLASSm_primitiveType

Constructor Summary

AccessConstructor and Description
public
MetadataMethod(MetadataFactory factory, MetadataClass metadataClass)

Create the method from the class metadata.

Method Summary

Modifier and TypeMethod and Description
public void
addParameter(String parameter)

INTERNAL:

public MetadataClass
getMetadataClass()

INTERNAL:

public MetadataMethod
getNext()

INTERNAL:

public List<String>
getParameters()

INTERNAL:

public String
getReturnType()

INTERNAL:

public MetadataMethod
getSetMethod()

INTERNAL: Method to convert a getMethod into a setMethod.

public MetadataMethod
getSetMethod(MetadataClass cls)

INTERNAL: Method to convert a getMethod into a setMethod.

public String
getSetMethodName()

INTERNAL:

public boolean
hasAttributeName()

INTERNAL:

public boolean
hasParameters()

INTERNAL:

public boolean
hasSetMethod()

INTERNAL:

public boolean
isALifeCycleCallbackMethod()

INTERNAL: Return true if it has a valid name (starts with get or is) and has a property name (getXyz or isXyz) and does not have parameters and has an associated set method.

protected boolean
isValidPersistenceMethod()

INTERNAL: Return true if it has a valid name (starts with 'get' or 'is') and has a property name (get'Xyz' or is'Xyz') and does not have parameters and has an associated set method.

public boolean
isValidPersistenceMethod(boolean mustBeExplicit, ClassAccessor classAccessor)

INTERNAL: Return true is this method is a valid persistence method.

public boolean
isValidPersistenceMethod(ClassAccessor classAccessor, boolean userDecorated)

INTERNAL: Return true is this method is a valid persistence method.

public boolean
public void
setMetadataClass(MetadataClass metadataClass)

INTERNAL:

public void
setNext(MetadataMethod next)

INTERNAL:

public void
setParameters(List<String> parameters)

INTERNAL:

public void
setReturnType(String returnType)

INTERNAL:

public void
setSetMethod(MetadataMethod method)

INTERNAL: Method to convert a getMethod into a setMethod.

Inherited from org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement:
addAnnotationaddGenericTypeaddMetaAnnotationareAnnotationsCompatibleWithTransientequalsgetAnnotationgetAnnotationgetAnnotationgetAnnotationgetAnnotationsgetAttributeNamegetDeclaredAnnotationsCountgetGenericTypegetMapKeyClassgetModifiersgetNamegetPrimitiveTypegetRawClassgetRawClassWithGenericsgetReferenceClassFromGenericgetTypehasDeclaredAnnotationshashCodeisAnnotationNotPresentisAnnotationNotPresentisAnnotationPresentisAnnotationPresentisAnnotationPresentisArrayisBasicisBasicCollectionisBasicMapisDerivedIdisDerivedIdClassisElementCollectionisEmbeddedisEmbeddedIdisGenericCollectionTypeisGenericTypeisIdisManyToManyisManyToOneisOneToManyisOneToOneisStructureisSupportedCollectionClassisSupportedMapClassisSupportedToManyCollectionClassisTransformationisValidPersistenceElementisValidPersistenceElementisVariableOneToOneisVersionsetAnnotationssetAttributeNamesetGenericTypesetModifierssetNamesetPrimitiveTypesetTypetoString

Field Detail

m_metadataClassback to summary
protected MetadataClass m_metadataClass

Class that the method is defined in.

m_nextback to summary
protected MetadataMethod m_next

Used to store multiple methods with the same name in a class.

m_parametersback to summary
protected List<String> m_parameters

List of class names of method parameters.

m_returnTypeback to summary
protected String m_returnType

Class name of method return type.

m_setMethodback to summary
protected MetadataMethod m_setMethod

Corresponding set method, if the method is an accessor get method.

Constructor Detail

MetadataMethodback to summary
public MetadataMethod(MetadataFactory factory, MetadataClass metadataClass)

Create the method from the class metadata.

Method Detail

addParameterback to summary
public void addParameter(String parameter)

INTERNAL:

getMetadataClassback to summary
public MetadataClass getMetadataClass()

INTERNAL:

getNextback to summary
public MetadataMethod getNext()

INTERNAL:

getParametersback to summary
public List<String> getParameters()

INTERNAL:

getReturnTypeback to summary
public String getReturnType()

INTERNAL:

getSetMethodback to summary
public MetadataMethod getSetMethod()

INTERNAL: Method to convert a getMethod into a setMethod. This method could return null if the corresponding set method is not found.

getSetMethodback to summary
public MetadataMethod getSetMethod(MetadataClass cls)

INTERNAL: Method to convert a getMethod into a setMethod. This method could return null if the corresponding set method is not found.

getSetMethodNameback to summary
public String getSetMethodName()

INTERNAL:

hasAttributeNameback to summary
public boolean hasAttributeName()

INTERNAL:

hasParametersback to summary
public boolean hasParameters()

INTERNAL:

hasSetMethodback to summary
public boolean hasSetMethod()

INTERNAL:

isALifeCycleCallbackMethodback to summary
public boolean isALifeCycleCallbackMethod()

INTERNAL: Return true if it has a valid name (starts with get or is) and has a property name (getXyz or isXyz) and does not have parameters and has an associated set method.

isValidPersistenceMethodback to summary
protected boolean isValidPersistenceMethod()

INTERNAL: Return true if it has a valid name (starts with 'get' or 'is') and has a property name (get'Xyz' or is'Xyz') and does not have parameters and has an associated set method.

isValidPersistenceMethodback to summary
public boolean isValidPersistenceMethod(boolean mustBeExplicit, ClassAccessor classAccessor)

INTERNAL: Return true is this method is a valid persistence method. This method will validate against any declared annotations on the method. If the mustBeExplicit flag is true, then we are processing the inverse of an explicit access setting and the property must have an Access(PROPERTY) setting to be processed. Otherwise, it is ignored.

isValidPersistenceMethodback to summary
public boolean isValidPersistenceMethod(ClassAccessor classAccessor, boolean userDecorated)

INTERNAL: Return true is this method is a valid persistence method. User decorated is used to indicate that the method either had persistence annotations defined on it or that it was specified in XML.

isValidPersistenceMethodNameback to summary
public boolean isValidPersistenceMethodName()

INTERNAL:

setMetadataClassback to summary
public void setMetadataClass(MetadataClass metadataClass)

INTERNAL:

setNextback to summary
public void setNext(MetadataMethod next)

INTERNAL:

setParametersback to summary
public void setParameters(List<String> parameters)

INTERNAL:

setReturnTypeback to summary
public void setReturnType(String returnType)

INTERNAL:

setSetMethodback to summary
public void setSetMethod(MetadataMethod method)

INTERNAL: Method to convert a getMethod into a setMethod.