Class XmlBindingsGenerator

java.lang.Object
org.eclipse.persistence.tools.dbws.XmlBindingsGenerator

public class XmlBindingsGenerator extends Object
This class is responsible for generating one or more EclipseLink XmlBindings objects based on a given list of XMLDescriptors.
  • Field Details

  • Constructor Details

    • XmlBindingsGenerator

      public XmlBindingsGenerator()
  • Method Details

    • generateXmlBindings

      public static List<XmlBindings> generateXmlBindings(List<ClassDescriptor> descriptors)
      Generate one or more XmlBindings based on a given list of XML Descriptor instances.
    • generateXmlBindings

      public static XmlBindings generateXmlBindings(String packageName, List<XMLDescriptor> descriptors)
      Generate an XmlBindings instance based on a list of XML descriptors. OXM metadata files are processed on a per package basis, hence it is assumed that the given list of descriptors are from the same package.
    • generateJavaType

      protected static JavaType generateJavaType(XMLDescriptor xdesc)
      Process a given XMLDescriptor and return a JavaType instance.
    • generateXmlAttribute

      protected static JAXBElement<XmlAttribute> generateXmlAttribute(XMLMapping xmap)
      Process a given XMLMapping and return a JAXBElement<XmlAttribute>. Expected mappings are:
      • org.eclipse.persistence.oxm.mappings.XMLBinaryDataMapping
      • org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping
      • org.eclipse.persistence.oxm.mappings.XMLDirectMapping
    • generateXmlElement

      protected static JAXBElement<XmlElement> generateXmlElement(XMLMapping xmap)
      Process a given XMLMapping and return a JAXBElement<XmlElement>. Expected mappings are:
      • org.eclipse.persistence.oxm.mappings.XMLBinaryDataMapping
      • org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping
      • org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping
      • org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping
      • org.eclipse.persistence.oxm.mappings.XMLDirectMapping
    • processXMLMapping

      protected static XmlAttribute processXMLMapping(XMLField xfld, String attName, String xpath, String attClassification, AbstractNullPolicy nullPolicy, String containerName, boolean inlineBinary, boolean isSWARef, String mimeType)
      Process a given XMLMapping and return an XmlAttribute.
    • processXMLBinaryDataMappingAttribute

      protected static XmlAttribute processXMLBinaryDataMappingAttribute(XMLBinaryDataMapping xmap)
      Process a given XMLBinaryDataMapping and return an XmlAttribute.
    • processXMLCompositeDirectCollectionMappingAttribute

      protected static XmlAttribute processXMLCompositeDirectCollectionMappingAttribute(XMLCompositeDirectCollectionMapping xmap)
      Process a given XMLCompositeDirectCollectionMapping and return an XmlAttribute.
    • processXMLDirectMappingAttribute

      protected static XmlAttribute processXMLDirectMappingAttribute(XMLDirectMapping xmap)
      Process a given XMLDirectMapping and return an XmlAttribute.
    • processXMLMapping

      protected static XmlElement processXMLMapping(XMLField xfld, String attName, String xpath, String attClassification, AbstractNullPolicy nullPolicy, boolean isCDATA, String containerName, boolean inlineBinary, boolean isSWARef, String mimeType)
      Process a given XMLMapping and return an XmlElement.
    • processXMLDirectMapping

      protected static XmlElement processXMLDirectMapping(XMLDirectMapping xmap)
      Process a given XMLDirectMapping and return an XmlElement.
    • processXMLBinaryDataMapping

      protected static XmlElement processXMLBinaryDataMapping(XMLBinaryDataMapping xmap)
      Process a given XMLBinaryDataMapping and return an XmlElement.
    • processXMLCompositeDirectCollectionMapping

      protected static XmlElement processXMLCompositeDirectCollectionMapping(XMLCompositeDirectCollectionMapping xmap)
      Process a given XMLCompositeDirectCollectionMapping and return an XmlElement.
    • processXMLCompositeObjectMapping

      protected static XmlElement processXMLCompositeObjectMapping(XMLCompositeObjectMapping xmap)
      Process a given XMLCompositeObjectMapping and return an XmlElement.
    • processXMLCompositeCollectionMapping

      protected static XmlElement processXMLCompositeCollectionMapping(XMLCompositeCollectionMapping xmap)
      Process a given XMLCompositeCollectionMapping and return an XmlElement
    • getPackageName

      protected static String getPackageName(String javaClassName)
      Convenience methods that returns the package name for a given fully qualified Java class name.
    • getClassName

      protected static String getClassName(String javaClassName)
      Convenience methods that returns the class name w/o package for a given fully qualified Java class name.
    • isDefaultNullPolicy

      protected static boolean isDefaultNullPolicy(AbstractNullPolicy nullPolicy)
      Indicates is a given AbstractNullPolicy is the default. This is useful if it is not desirable to write out the default policy in the oxm metadata file. The default policy is NullPolicy, with the following set:
      • isNullRepresentedByXsiNil = false
      • isNullRepresentedByEmptyNode = true
      • isSetPerformedForAbsentNode = true
      • marshalNullRepresentation = XMLNullRepresentationType.ABSENT_NODE