Class XMLProcessor
java.lang.Object
org.eclipse.persistence.jaxb.compiler.XMLProcessor
INTERNAL:
Purpose: XMLProcessor is used to process the meta data provided in external OXM XML files. This information is then used in conjunction with the information from AnnotationsProcess to generate schemas (via SchemaGenerator) and mappings (via MappingsGenerator).
As a general rule meta data provided in external OXM XML files overrides meta data specified through annotations.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionXMLProcessor
(Map<String, XmlBindings> bindings) This is the preferred constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
classExistsInArray
(JavaClass theClass, ArrayList<JavaClass> existingClasses) Convenience method to determine if a class exists in a given ArrayList.static String
getNameFromXPath
(String xpath, String propertyName, boolean isAttribute) Convenience method that returns the field name for a given xml-path.static XmlBindings
mergeXmlBindings
(List<XmlBindings> bindings) This method is used to merge several bindings files into one XMLBindings object.void
processXML
(AnnotationsProcessor annotationsProcessor, JavaModelInput jModelInput, TypeMappingInfo[] typeMappingInfos, JavaClass[] originalJavaClasses) Process XmlBindings on a per package basis for a given AnnotationsProcessor instance.void
reapplyPackageAndClassAdapters
(Property prop, TypeInfo owningInfo) This method checks for class and package level adapters after the type of a property has been set.
-
Field Details
-
DEFAULT
- See Also:
-
GENERATE
- See Also:
-
-
Constructor Details
-
XMLProcessor
This is the preferred constructor.- Parameters:
bindings
-
-
-
Method Details
-
processXML
public void processXML(AnnotationsProcessor annotationsProcessor, JavaModelInput jModelInput, TypeMappingInfo[] typeMappingInfos, JavaClass[] originalJavaClasses) Process XmlBindings on a per package basis for a given AnnotationsProcessor instance.- Parameters:
annotationsProcessor
-
-
classExistsInArray
Convenience method to determine if a class exists in a given ArrayList. The classes are compared via equals() method. -
getNameFromXPath
Convenience method that returns the field name for a given xml-path. This method would typically be called when building a QName to set as the 'SchemaName' on a Property. Examples: - returns 'id' for xml-path '@id' - returns 'managerId' for xml-path 'projects/prj:project/@prj:managerId' - returns 'first-name' for xml-path 'info/personal-info/first-name/text()' - returns 'project' for xml-path 'projects/prj:project/text()' - returns 'data' for xml-path 'pieces-of-data/data[1]/text()'- Parameters:
xpath
-propertyName
-isAttribute
-- Returns:
-
reapplyPackageAndClassAdapters
This method checks for class and package level adapters after the type of a property has been set.- Parameters:
prop
- the property that needs to be updatedowningInfo
- the typeInfo that represents the owner of this property.
-
mergeXmlBindings
This method is used to merge several bindings files into one XMLBindings object.- Parameters:
bindings
- the list of XmlBindings objects to merge.- Returns:
- XmlBindings object representing the merged files.
-