Class JAXBSetMethodAttributeAccessor
- java.lang.Object
-
- org.eclipse.persistence.mappings.AttributeAccessor
-
- org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor
-
- org.eclipse.persistence.internal.jaxb.JAXBSetMethodAttributeAccessor
-
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreAttributeAccessor
public class JAXBSetMethodAttributeAccessor extends 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(String parameterTypeAsString, 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 Class
getAttributeClass()
Return the return type of the method accessor.void
initializeAttributes(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
-
-
-
-
Constructor Detail
-
JAXBSetMethodAttributeAccessor
public JAXBSetMethodAttributeAccessor(String parameterTypeAsString, 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(Class theJavaClass) throws DescriptorException
Override to avoid exceptions due to lack of get method.- Specified by:
initializeAttributes
in interfaceCoreAttributeAccessor
- Overrides:
initializeAttributes
in classMethodAttributeAccessor
- Throws:
DescriptorException
-
getAttributeClass
public Class getAttributeClass()
Return the return type of the method accessor.- Specified by:
getAttributeClass
in interfaceCoreAttributeAccessor
- Overrides:
getAttributeClass
in classMethodAttributeAccessor
-
-