Module org.eclipse.persistence.core
Interface Field<CONVERSION_MANAGER extends ConversionManager,NAMESPACE_RESOLVER extends NamespaceResolver>
- All Superinterfaces:
CoreField
- All Known Subinterfaces:
UnionField<CONVERSION_MANAGER,NAMESPACE_RESOLVER>
- All Known Implementing Classes:
XMLField,XMLUnionField
public interface Field<CONVERSION_MANAGER extends ConversionManager,NAMESPACE_RESOLVER extends NamespaceResolver>
extends CoreField
-
Method Summary
Modifier and TypeMethodDescriptionconvertValueBasedOnSchemaType(Object value, CONVERSION_MANAGER xmlConversionManager, AbstractUnmarshalRecord record) INTERNAL: Called from DOMRecord and XMLReader.Class<?> getJavaClass(QName qname, ConversionManager conversionManager) Return the class for a given qualified XML Schema typeINTERNAL: Return the last XPathFragment.getName()Return the unqualified name of the field.Get the NamespaceResolver associated with this XMLFieldReturn the schema type associated with this fieldgetSchemaTypeForValue(Object value, CoreAbstractSession session) INTERNAL:Class<?> getType()getXMLType(Class<?> javaClass, ConversionManager conversionManager) Return the qualified XML Schema type for a given classgetXPath()Returns the xpath statement associated with this XMLFieldINTERNAL: Maintain a direct pointer to the first XPathFragment.booleanINTERNAL:voidbooleanisCDATA()INTERNAL:booleanINTERNAL:booleanIndicates if this XMLField represents a "required" XML element or attribute ([minOccurs="1"] for elements, [use="required"] for attributes).booleanisSchemaType(QName schemaType) INTERNALbooleanINTERNAL: Indicates if the xpath for this field is "."booleanReturns if the field is a typed text field True when we should base conversions on the "type" attribute on elementsbooleanINTERNAL: Returns false since this is a union field The subclass XMLUnionField returns true for thisvoidsetIsCDATA(boolean CDATA) INTERNAL:voidsetIsTypedTextField(boolean value) Set if the field is a typed text field True when we should base conversions on the "type" attribute on elementsvoidsetNamespaceResolver(NAMESPACE_RESOLVER newNamespaceResolver) Set the NamespaceResolver associated with this XMLFieldvoidsetNestedArray(boolean nestedArray) Set nested array flag.voidsetRequired(boolean isRequired) Set whether this XMLField represents a "required" XML element or attribute ([minOccurs="1"] for elements, [use="required"] for attributes).voidsetSchemaType(QName value) Sets the schematype associated with this XMLField This is an optional setting; when set the schema type will be used to format the XML appropriatelyvoidsetUsesSingleNode(boolean usesSingleNode) Sets whether the mapping uses a single node.voidSet the xpath statment for this XMLField.booleanChecks whether the mapping uses a single node.
-
Method Details
-
convertValueBasedOnSchemaType
Object convertValueBasedOnSchemaType(Object value, CONVERSION_MANAGER xmlConversionManager, AbstractUnmarshalRecord record) INTERNAL: Called from DOMRecord and XMLReader. MappingNodeValues call XMLReader which calls this method so that other XMLReader subclasses can override. -
getJavaClass
Return the class for a given qualified XML Schema type- Parameters:
qname- The qualified name of the XML Schema type to use as a key in the lookup- Returns:
- The class corresponding to the specified schema type, if no corresponding match found returns null
-
getLastXPathFragment
XPathFragment getLastXPathFragment()INTERNAL: Return the last XPathFragment. -
getLeafElementType
QName getLeafElementType() -
getName
String getName()Return the unqualified name of the field. -
getNamespaceResolver
NAMESPACE_RESOLVER getNamespaceResolver()Get the NamespaceResolver associated with this XMLField- Returns:
- The NamespaceResolver associated with this XMLField
-
getSchemaType
QName getSchemaType()Return the schema type associated with this field- Returns:
- the schema type
-
getSchemaTypeForValue
INTERNAL: -
getType
Class<?> getType() -
getXMLType
Return the qualified XML Schema type for a given class- Parameters:
javaClass- The class to use as a key in the lookup- Returns:
- QName The qualified XML Schema type, if no corresponding match found returns null
-
getXPath
String getXPath()Returns the xpath statement associated with this XMLField- Returns:
- The xpath statement associated with this XMLField
-
getXPathFragment
XPathFragment getXPathFragment()INTERNAL: Maintain a direct pointer to the first XPathFragment. For example given the following XPath first/middle/@last, first is the first XPathFragment. -
hasLastXPathFragment
boolean hasLastXPathFragment()INTERNAL: -
initialize
void initialize() -
isCDATA
boolean isCDATA()INTERNAL: -
isRequired
boolean isRequired()Indicates if this XMLField represents a "required" XML element or attribute ([minOccurs="1"] for elements, [use="required"] for attributes). NOTE: This API is used only for Schema Generation.- See Also:
-
isSchemaType
INTERNAL -
isSelfField
boolean isSelfField()INTERNAL: Indicates if the xpath for this field is "."- Returns:
- true if the xpath is ".", false otherwise
-
isTypedTextField
boolean isTypedTextField()Returns if the field is a typed text field True when we should base conversions on the "type" attribute on elements- Returns:
- True when we should base conversions on the "type" attribute on elements, otherwise false
-
isUnionField
boolean isUnionField()INTERNAL: Returns false since this is a union field The subclass XMLUnionField returns true for this -
setIsCDATA
void setIsCDATA(boolean CDATA) INTERNAL: -
setIsTypedTextField
void setIsTypedTextField(boolean value) Set if the field is a typed text field True when we should base conversions on the "type" attribute on elements- Parameters:
value- The boolean value specifiy if this is a typed text field
-
setNamespaceResolver
Set the NamespaceResolver associated with this XMLField- Parameters:
newNamespaceResolver- The namespaceResolver to be associated with this XMLField
-
setRequired
void setRequired(boolean isRequired) Set whether this XMLField represents a "required" XML element or attribute ([minOccurs="1"] for elements, [use="required"] for attributes). NOTE: This API is used only for Schema Generation.- See Also:
-
setSchemaType
Sets the schematype associated with this XMLField This is an optional setting; when set the schema type will be used to format the XML appropriately- Parameters:
value- QName to be added to the list of schema types
-
setUsesSingleNode
void setUsesSingleNode(boolean usesSingleNode) Sets whether the mapping uses a single node.- Parameters:
usesSingleNode- True if the items in the collection are in a single node or false if each of the items in the collection is in its own node
-
setXPath
Set the xpath statment for this XMLField.- Parameters:
xPath- The xpath statement to be associated with this XMLField
-
usesSingleNode
boolean usesSingleNode()Checks whether the mapping uses a single node.- Returns:
- True if the items in the collection are in a single node or false if each of the items in the collection is in its own node.
-
setNestedArray
void setNestedArray(boolean nestedArray) Set nested array flag. Used in JSON marshalling.- Parameters:
nestedArray- flag.
-
isNestedArray
boolean isNestedArray()INTERNAL:- Returns:
- True if content is nested array.
-