Class 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 Detail

      • m_metadataClass

        protected MetadataClass m_metadataClass
        Class that the method is defined in.
      • m_returnType

        protected String m_returnType
        Class name of method return type.
      • m_parameters

        protected List<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​(String parameter)
        INTERNAL:
      • getMetadataClass

        public MetadataClass getMetadataClass()
        INTERNAL:
      • getParameters

        public List<String> getParameters()
        INTERNAL:
      • getReturnType

        public 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 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:
      • setParameters

        public void setParameters​(List<String> parameters)
        INTERNAL:
      • setReturnType

        public void setReturnType​(String returnType)
        INTERNAL: