Class MetadataMethod
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject
-
- org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement
-
- org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataMethod
-
public class MetadataMethod extends MetadataAnnotatedElement
INTERNAL: An object to hold onto a valid JPA decorated method.- Since:
- TopLink 10.1.3/EJB 3.0 Preview
- Author:
- Guy Pelletier
-
-
Field Summary
Fields Modifier and Type Field Description protected MetadataClassm_metadataClassClass that the method is defined in.protected MetadataMethodm_nextUsed to store multiple methods with the same name in a class.protected java.util.List<java.lang.String>m_parametersList of class names of method parameters.protected java.lang.Stringm_returnTypeClass name of method return type.protected MetadataMethodm_setMethodCorresponding set method, if the method is an accessor get method.-
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement
DEFAULT_RAW_CLASS
-
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject
m_factory
-
-
Constructor Summary
Constructors Constructor Description MetadataMethod(MetadataFactory factory, MetadataClass metadataClass)Create the method from the class metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParameter(java.lang.String parameter)INTERNAL:MetadataClassgetMetadataClass()INTERNAL:MetadataMethodgetNext()INTERNAL:java.util.List<java.lang.String>getParameters()INTERNAL:java.lang.StringgetReturnType()INTERNAL:MetadataMethodgetSetMethod()INTERNAL: Method to convert a getMethod into a setMethod.MetadataMethodgetSetMethod(MetadataClass cls)INTERNAL: Method to convert a getMethod into a setMethod.java.lang.StringgetSetMethodName()INTERNAL:booleanhasAttributeName()INTERNAL:booleanhasParameters()INTERNAL:booleanhasSetMethod()INTERNAL:booleanisALifeCycleCallbackMethod()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 booleanisValidPersistenceMethod()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.booleanisValidPersistenceMethod(boolean mustBeExplicit, ClassAccessor classAccessor)INTERNAL: Return true is this method is a valid persistence method.booleanisValidPersistenceMethod(ClassAccessor classAccessor, boolean userDecorated)INTERNAL: Return true is this method is a valid persistence method.booleanisValidPersistenceMethodName()INTERNAL:voidsetMetadataClass(MetadataClass metadataClass)INTERNAL:voidsetNext(MetadataMethod next)INTERNAL:voidsetParameters(java.util.List<java.lang.String> parameters)INTERNAL:voidsetReturnType(java.lang.String returnType)INTERNAL:voidsetSetMethod(MetadataMethod method)INTERNAL: Method to convert a getMethod into a setMethod.-
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement
addAnnotation, addGenericType, addMetaAnnotation, areAnnotationsCompatibleWithTransient, equals, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotations, getAttributeName, getDeclaredAnnotationsCount, getGenericType, getMapKeyClass, getModifiers, getName, getPrimitiveType, getRawClass, getRawClassWithGenerics, getReferenceClassFromGeneric, getType, hasDeclaredAnnotations, hashCode, isAnnotationNotPresent, isAnnotationNotPresent, isAnnotationPresent, isAnnotationPresent, isAnnotationPresent, isArray, isBasic, isBasicCollection, isBasicMap, isDerivedId, isDerivedIdClass, isElementCollection, isEmbedded, isEmbeddedId, isGenericCollectionType, isGenericType, isId, isManyToMany, isManyToOne, isOneToMany, isOneToOne, isStructure, isSupportedCollectionClass, isSupportedMapClass, isSupportedToManyCollectionClass, isTransformation, isValidPersistenceElement, isValidPersistenceElement, isVariableOneToOne, isVersion, setAnnotations, setAttributeName, setGenericType, setModifiers, setName, setPrimitiveType, setType, toString
-
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject
getLogger, getMetadataClass, getMetadataFactory, setMetadataFactory
-
-
-
-
Field Detail
-
m_metadataClass
protected MetadataClass m_metadataClass
Class that the method is defined in.
-
m_returnType
protected java.lang.String m_returnType
Class name of method return type.
-
m_parameters
protected java.util.List<java.lang.String> m_parameters
List of class names of method parameters.
-
m_setMethod
protected MetadataMethod m_setMethod
Corresponding set method, if the method is an accessor get method.
-
m_next
protected MetadataMethod m_next
Used to store multiple methods with the same name in a class.
-
-
Constructor Detail
-
MetadataMethod
public MetadataMethod(MetadataFactory factory, MetadataClass metadataClass)
Create the method from the class metadata.
-
-
Method Detail
-
addParameter
public void addParameter(java.lang.String parameter)
INTERNAL:
-
getMetadataClass
public MetadataClass getMetadataClass()
INTERNAL:
-
getNext
public MetadataMethod getNext()
INTERNAL:
-
getParameters
public java.util.List<java.lang.String> getParameters()
INTERNAL:
-
getReturnType
public java.lang.String getReturnType()
INTERNAL:
-
getSetMethod
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.
-
setSetMethod
public void setSetMethod(MetadataMethod method)
INTERNAL: Method to convert a getMethod into a setMethod.
-
getSetMethod
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.
-
getSetMethodName
public java.lang.String getSetMethodName()
INTERNAL:
-
hasAttributeName
public boolean hasAttributeName()
INTERNAL:
-
hasParameters
public boolean hasParameters()
INTERNAL:
-
hasSetMethod
public boolean hasSetMethod()
INTERNAL:
-
isALifeCycleCallbackMethod
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.
-
isValidPersistenceMethod
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.
-
isValidPersistenceMethod
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.
-
isValidPersistenceMethod
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.
-
isValidPersistenceMethodName
public boolean isValidPersistenceMethodName()
INTERNAL:
-
setMetadataClass
public void setMetadataClass(MetadataClass metadataClass)
INTERNAL:
-
setNext
public void setNext(MetadataMethod next)
INTERNAL:
-
setParameters
public void setParameters(java.util.List<java.lang.String> parameters)
INTERNAL:
-
setReturnType
public void setReturnType(java.lang.String returnType)
INTERNAL:
-
-