Class JAXBSetMethodAttributeAccessor

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.eclipse.persistence.core.mappings.CoreAttributeAccessor

    public class JAXBSetMethodAttributeAccessor
    extends org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor
    This accessor should be used when processing a class that uses method access, and a has set method but no get method. The get method is required during mapping initialization to determine the type of the set method's input parameter, and an exception will occur if none is present. Using this custom method accessor, the input parameter of the set method can be set (as a string) and loaded (using the provided classloader) during the initialization phase. Two methods are overridden to avoid exceptions due to lack of a get method: - initializeAttributes - getAttributeClass
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor

        getMethod, getMethodName, setMethod, setMethodName
      • Fields inherited from class org.eclipse.persistence.mappings.AttributeAccessor

        attributeName, isReadOnly, isWriteOnly
    • Constructor Summary

      Constructors 
      Constructor Description
      JAXBSetMethodAttributeAccessor​(java.lang.String parameterTypeAsString, java.lang.ClassLoader loader)
      This constructor sets the set method input parameter type (as string) as well as the classloader that will be used to load the associated class during initialization.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class getAttributeClass()
      Return the return type of the method accessor.
      void initializeAttributes​(java.lang.Class theJavaClass)
      Override to avoid exceptions due to lack of get method.
      • Methods inherited from class org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor

        getAttributeValueFromObject, getAttributeValueFromObject, getGetMethod, getGetMethodName, getGetMethodReturnType, getSetMethod, getSetMethodName, getSetMethodParameterType, getSetMethodParameterType, getSetMethodParameterTypes, initializeAttributes, isInitialized, isMethodAttributeAccessor, setAttributeValueInObject, setAttributeValueInObject, setGetMethod, setGetMethodName, setSetMethod, setSetMethodName
      • Methods inherited from class org.eclipse.persistence.mappings.AttributeAccessor

        clone, getAttributeName, isInstanceVariableAttributeAccessor, isMapValueAttributeAccessor, isReadOnly, isValuesAccessor, isVirtualAttributeAccessor, isWriteOnly, setAttributeName, setIsReadOnly, setIsWriteOnly
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JAXBSetMethodAttributeAccessor

        public JAXBSetMethodAttributeAccessor​(java.lang.String parameterTypeAsString,
                                              java.lang.ClassLoader loader)
        This constructor sets the set method input parameter type (as string) as well as the classloader that will be used to load the associated class during initialization.
        Parameters:
        parameterTypeAsString -
        loader -
    • Method Detail

      • initializeAttributes

        public void initializeAttributes​(java.lang.Class theJavaClass)
                                  throws org.eclipse.persistence.exceptions.DescriptorException
        Override to avoid exceptions due to lack of get method.
        Specified by:
        initializeAttributes in interface org.eclipse.persistence.core.mappings.CoreAttributeAccessor
        Overrides:
        initializeAttributes in class org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor
        Throws:
        org.eclipse.persistence.exceptions.DescriptorException
      • getAttributeClass

        public java.lang.Class getAttributeClass()
        Return the return type of the method accessor.
        Specified by:
        getAttributeClass in interface org.eclipse.persistence.core.mappings.CoreAttributeAccessor
        Overrides:
        getAttributeClass in class org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor