public final class Object2Dom extends XMLObjectStore
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID_ATTR |
static java.lang.String |
IDREF_ATTR |
static java.lang.String |
ITEM_TAG |
static java.util.HashSet<java.lang.String> |
obsoleteClassNames |
static int |
REPORT_DATA_CONSTRAINT_ERRORS |
static int |
REPORT_NO_ERRORS |
static int |
REPORT_VALIDATION_ERRORS |
static int |
REPORT_WELL_FORMED_ERRORS |
static java.lang.String |
XMLNS_ATTR |
static java.lang.String |
XMLNS_URI |
CLASS_ATTR, NSELEM_ATTR
Modifier and Type | Method and Description |
---|---|
static void |
exemptTypeFromIdref(java.lang.Class type) |
static org.w3c.dom.NodeList |
getChildrenByTagName(org.w3c.dom.Element element, java.lang.String tag) |
java.net.URL |
getDocumentURL()
Returns the
URL of the current document that is being marshalled or unmarshalled. |
java.lang.String |
getEncoding() |
boolean |
isIncludeNulls()
Return whether null values should be included as empty elements or if they should be omitted from the document.
|
boolean |
isNamedArrayElems()
Return whether array elements should be named or just be generic.
|
boolean |
isNullIfEmpty()
Return whether empty values should be converted to null.
|
java.lang.Object |
load(java.net.URL url)
Creates a new instance of an object based on its peristent state saved at the specified
URL . |
void |
marshalAttributes(org.w3c.dom.Element element, java.lang.Object object)
Sets the attributes on the specified
Element to correspond to the attribute properties from the specified object. |
static Object2Dom |
newInstance()
Factory method for creating a new instance of
Object2Dom that is configured with the (strongly) recommended options. |
static Object2Dom |
newInstanceForSchemaCompiledBeans()
Factory method for creating a new instance of
Object2Dom that is configured to marshal JavaBeans that are designed to conform to a DTD. |
boolean |
open(java.net.URL url, java.lang.Object object)
Initializes the specified object based on its persistent state that is saved at the specified
URL . |
static void |
registerConverter(ToDomConverter converter) |
static void |
registerDoctype(java.lang.Class objectClass, java.lang.String rootName, java.lang.String publicID, java.lang.String systemID) |
static void |
registerNamespaceElem(java.lang.Class objectClass, java.lang.String namespaceURI, java.lang.String localElemName)
This method associates the specified namespace URI and local element name with the objectClass.
|
boolean |
save(java.net.URL url, java.lang.Object object)
Marshals the persistent properties of the specified object and saves the persistent form at the specified
URL . |
void |
setDoctypeID(java.lang.String publicID, java.lang.String systemID) |
void |
setDocumentURL(java.net.URL documentURL)
Sets the base document
URL that all URLs should be resolved against. |
void |
setDTD(oracle.xml.parser.v2.DTD dtd)
WARNING: This method is still in the prototype stage.
|
void |
setEncoding(java.lang.String encoding) |
void |
setLogger(int reportLevel, Object2DomLogger logger)
WARNING: This method is still in the prototype stage.
|
void |
setNamespaceURI(java.lang.String namespaceURI) |
void |
setTemporaryIgnoreClassNames(java.util.Collection<java.lang.String> tempIgnoreClasses) |
oracle.xml.parser.v2.XMLDocument |
toDocument(java.lang.Object object, java.lang.String rootTag) |
oracle.xml.parser.v2.XMLDocument |
toDocument(java.lang.Object object, java.lang.String rootTag, java.lang.Class defaultClass) |
oracle.xml.parser.v2.XMLDocument |
toDocument(java.lang.Object object, java.lang.String rootTag, java.lang.Class defaultClass, java.net.URL outURL) |
oracle.xml.parser.v2.XMLDocument |
toDocument(java.lang.Object object, java.lang.String rootTag, java.net.URL outURL) |
org.w3c.dom.Element |
toElement(java.lang.Object object, java.lang.String tag, java.lang.Class defaultClass)
Deprecated.
Need to use toElement( Object, String, Class, String ) instead.
|
org.w3c.dom.Element |
toElement(java.lang.Object object, java.lang.String tag, java.lang.Class defaultClass, java.lang.String namespaceURI)
Recursive method that converts the given
Object into a DOM Element with the given tag . |
org.w3c.dom.Element |
toElement(oracle.xml.parser.v2.XMLDocument document, java.lang.Object object, java.lang.String tag, java.lang.Class defaultClass, java.lang.String namespaceURI)
This is a bit of a hack to allow using Object2Dom to convert a single object to an Element without it traversing the entire document.
|
java.lang.Object |
toObject(org.w3c.dom.Element element, java.lang.Class defaultClass)
Deprecated.
|
java.lang.Object |
toObject(org.w3c.dom.Element element, java.lang.Class defaultClass, boolean nullIfEmpty, java.lang.ClassLoader loader, boolean setup) |
java.lang.Object |
toObject(org.w3c.dom.Element element, java.lang.Class defaultClass, java.lang.ClassLoader loader)
Recursive method that converts the given
Element into an object. |
java.lang.Object |
toObject(java.io.InputStream inputStream, java.lang.Class defaultClass)
Deprecated.
Use toObject(InputStream,Class,ClassLoader) instead.
|
java.lang.Object |
toObject(java.io.InputStream inputStream, java.lang.Class defaultClass, java.lang.ClassLoader cl) |
java.lang.Object |
toObject(java.io.Reader reader, java.lang.Class defaultClass)
Deprecated.
Use toObject(Reader,Class,ClassLoader) instead.
|
java.lang.Object |
toObject(java.io.Reader reader, java.lang.Class defaultClass, java.lang.ClassLoader cl) |
java.lang.Object |
toObject(java.net.URL url)
Will load classes using the classloader of idert.
|
java.lang.Object |
toObject(java.net.URL url, java.lang.Class defaultClass) |
java.lang.Object |
toObject(java.net.URL url, java.lang.Class defaultClass, java.lang.ClassLoader loader) |
java.lang.Object |
toObject(java.net.URL url, java.lang.ClassLoader cl) |
java.lang.Object |
toObject(oracle.xml.parser.v2.XMLDocument document) |
java.lang.Object |
toObject(oracle.xml.parser.v2.XMLDocument document, java.lang.Class defaultClass)
Deprecated.
|
java.lang.Object |
toObject(oracle.xml.parser.v2.XMLDocument document, java.lang.Class defaultClass, java.lang.ClassLoader loader) |
void |
unmarshalAttributes(org.w3c.dom.Element element, java.lang.Object object)
Sets the properties on the specified object based on the attributes that are in the specified
Element . |
registerTransform
public static final int REPORT_NO_ERRORS
public static final int REPORT_WELL_FORMED_ERRORS
public static final int REPORT_VALIDATION_ERRORS
public static final int REPORT_DATA_CONSTRAINT_ERRORS
public static final java.lang.String ID_ATTR
public static final java.lang.String IDREF_ATTR
public static final java.lang.String XMLNS_ATTR
public static final java.lang.String XMLNS_URI
public static final java.lang.String ITEM_TAG
public static final java.util.HashSet<java.lang.String> obsoleteClassNames
public static Object2Dom newInstance()
Object2Dom
that is configured with the (strongly) recommended options.public static Object2Dom newInstanceForSchemaCompiledBeans()
Object2Dom
that is configured to marshal JavaBeans that are designed to conform to a DTD. The Object2Dom instance is configured to omit annotations (such as ID and class attributes) and substructures (such as "Item" elements) so that these do not interfere with DTD compliance.
Use newInstance()
instead, whenever possible.
public oracle.xml.parser.v2.XMLDocument toDocument(java.lang.Object object, java.lang.String rootTag, java.net.URL outURL) throws java.io.IOException
java.io.IOException
public oracle.xml.parser.v2.XMLDocument toDocument(java.lang.Object object, java.lang.String rootTag, java.lang.Class defaultClass, java.net.URL outURL) throws java.io.IOException
java.io.IOException
public oracle.xml.parser.v2.XMLDocument toDocument(java.lang.Object object, java.lang.String rootTag)
public oracle.xml.parser.v2.XMLDocument toDocument(java.lang.Object object, java.lang.String rootTag, java.lang.Class defaultClass)
@Deprecated public java.lang.Object toObject(java.io.InputStream inputStream, java.lang.Class defaultClass) throws java.io.IOException
java.io.IOException
public java.lang.Object toObject(java.io.InputStream inputStream, java.lang.Class defaultClass, java.lang.ClassLoader cl) throws java.io.IOException
java.io.IOException
@Deprecated public java.lang.Object toObject(java.io.Reader reader, java.lang.Class defaultClass) throws java.io.IOException
java.io.IOException
public java.lang.Object toObject(java.io.Reader reader, java.lang.Class defaultClass, java.lang.ClassLoader cl) throws java.io.IOException
java.io.IOException
public java.lang.Object toObject(java.net.URL url, java.lang.ClassLoader cl) throws java.io.IOException
java.io.IOException
public java.lang.Object toObject(java.net.URL url) throws java.io.IOException
java.io.IOException
public java.lang.Object toObject(java.net.URL url, java.lang.Class defaultClass, java.lang.ClassLoader loader) throws java.io.IOException
java.io.IOException
public java.lang.Object toObject(java.net.URL url, java.lang.Class defaultClass) throws java.io.IOException
java.io.IOException
public java.lang.Object toObject(oracle.xml.parser.v2.XMLDocument document)
public java.lang.Object toObject(oracle.xml.parser.v2.XMLDocument document, java.lang.Class defaultClass, java.lang.ClassLoader loader)
@Deprecated public java.lang.Object toObject(oracle.xml.parser.v2.XMLDocument document, java.lang.Class defaultClass)
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
public void setDoctypeID(java.lang.String publicID, java.lang.String systemID)
public void setDTD(oracle.xml.parser.v2.DTD dtd)
public void setNamespaceURI(java.lang.String namespaceURI)
public void setLogger(int reportLevel, Object2DomLogger logger)
public void setTemporaryIgnoreClassNames(java.util.Collection<java.lang.String> tempIgnoreClasses)
public static void registerConverter(ToDomConverter converter)
public static void registerDoctype(java.lang.Class objectClass, java.lang.String rootName, java.lang.String publicID, java.lang.String systemID)
public static void registerNamespaceElem(java.lang.Class objectClass, java.lang.String namespaceURI, java.lang.String localElemName)
This method is part of the version migration support implemented by Object2Dom.
objectClass
-namespaceURI
-localElemName
- This is written into the "nselem" attribute. It's intended to be used by XSLT-based migration transformations.public static void exemptTypeFromIdref(java.lang.Class type)
public boolean isNamedArrayElems()
_namedArrayElems
field for details.public boolean isNullIfEmpty()
_nullIfEmpty
field for details.public boolean isIncludeNulls()
_includeNulls
field for details.@Deprecated public org.w3c.dom.Element toElement(java.lang.Object object, java.lang.String tag, java.lang.Class defaultClass)
public org.w3c.dom.Element toElement(java.lang.Object object, java.lang.String tag, java.lang.Class defaultClass, java.lang.String namespaceURI)
Object
into a DOM Element
with the given tag
. The class is expressed explicitly as an XML attribute if the object type does not match defaultClass
.
NOTE: This method should not be called directly by application code. This is intended to be called by classes that implement ToDomConverter
when they need to recurse.
public java.lang.Object toObject(org.w3c.dom.Element element, java.lang.Class defaultClass, java.lang.ClassLoader loader)
Element
into an object. If the element does not provide a class type explicitly, the defaultType
is used to instantiate the object.
NOTE: This method should not be called directly by application code. This is intended to be called by classes that implement ToDomConverter
when they need to recurse.
@Deprecated public java.lang.Object toObject(org.w3c.dom.Element element, java.lang.Class defaultClass)
public static org.w3c.dom.NodeList getChildrenByTagName(org.w3c.dom.Element element, java.lang.String tag)
public void marshalAttributes(org.w3c.dom.Element element, java.lang.Object object)
Element
to correspond to the attribute properties from the specified object.public void unmarshalAttributes(org.w3c.dom.Element element, java.lang.Object object)
Element
.public java.lang.Object load(java.net.URL url) throws java.io.IOException
ObjectStore
URL
.java.io.IOException
public boolean open(java.net.URL url, java.lang.Object object) throws java.io.IOException
ObjectStore
URL
. This has the effect of reloading or reverting an object's in-memory state.java.io.IOException
public boolean save(java.net.URL url, java.lang.Object object) throws java.io.IOException
ObjectStore
URL
.java.io.IOException
public java.net.URL getDocumentURL()
URL
of the current document that is being marshalled or unmarshalled. If there is no current URL
then null
is returned. This URL
is used for resolving and unresolving URL
properties within objects so that they are stored using relative paths or using portions of paths that are based on macro definitions.public void setDocumentURL(java.net.URL documentURL)
URL
that all URLs should be resolved against. The base document URL
does not need to have its filename trimmed off.public org.w3c.dom.Element toElement(oracle.xml.parser.v2.XMLDocument document, java.lang.Object object, java.lang.String tag, java.lang.Class defaultClass, java.lang.String namespaceURI)
public java.lang.Object toObject(org.w3c.dom.Element element, java.lang.Class defaultClass, boolean nullIfEmpty, java.lang.ClassLoader loader, boolean setup)