|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.wutka.jox.JOXBeanOutput
|
+--com.wutka.jox.JOXBeanDOM
Converts a Java Bean into an XML Document. If you don't supply a Document object, this class uses the DocumentBuilder to create a new document. For some tools like the Xalan XSL processor, you must use a specific Document implementation (the Xerces implementation). If you need to use Xalan, create your own Document using the Xerces API and pass it to one of the JOXBeanDOM constructors.
| Field Summary | |
protected static java.util.Hashtable |
beanCache
|
protected org.w3c.dom.Document |
document
|
| Fields inherited from class com.wutka.jox.JOXBeanOutput |
attrTranslation,
beanCache,
childTranslation,
dateFormat,
dtd,
getParams,
nameTranslation,
outputStream,
WRITE_AS_ATTRIBUTE,
WRITE_AS_ELEMENT,
WRITE_AS_INDEXED_ELEMENT,
writeAttributes |
| Constructor Summary | |
JOXBeanDOM()
Creates a JOXBeanDOM that stores simple properties as attributes |
|
JOXBeanDOM(boolean writeAttributesFlag)
Creates a JOXBeanDOM that doesn't use a DTD |
|
JOXBeanDOM(org.w3c.dom.Document aDocument)
Creates a JOXBeanDOM that stores simple properties as attributes |
|
JOXBeanDOM(org.w3c.dom.Document aDocument,
boolean writeAttributesFlag)
Creates a JOXBeanDOM that doesn't use a DTD |
|
JOXBeanDOM(org.w3c.dom.Document aDocument,
com.wutka.dtd.DTD aDTD)
Creates a JOXBeanDOM that uses a DTD to determine which attributes to store and what the format of the names should be. |
|
JOXBeanDOM(org.w3c.dom.Document aDocument,
java.lang.String dtdURL)
Creates a JOXBeanDOM that uses a DTD to determine which attributes to store and what the format of the names should be. |
|
JOXBeanDOM(com.wutka.dtd.DTD aDTD)
Creates a JOXBeanDOM that uses a DTD to determine which attributes to store and what the format of the names should be. |
|
JOXBeanDOM(java.lang.String dtdURL)
Creates a JOXBeanDOM that uses a DTD to determine which attributes to store and what the format of the names should be. |
|
| Method Summary | |
org.w3c.dom.Document |
beanToDocument(java.lang.String rootName,
java.lang.Object ob)
Stores a Java bean in an XML document (this is the main method for JOXBeanDOM). |
protected void |
createDocument()
Creates a new Document using a DocumentBuilder |
void |
storeBasicType(java.lang.String xmlTagName,
java.lang.String propName,
java.lang.Object propValue,
int writeType,
org.w3c.dom.Element parentElement)
Writes out a basic type including the opening and closing tags. |
void |
storeDate(java.lang.String xmlTagName,
java.lang.String propName,
java.lang.Object propValue,
int writeType,
org.w3c.dom.Element parentElement)
Writes out a date including the opening and closing tags |
void |
storeIndexedProperty(java.lang.String xmlTagName,
java.lang.Object ob,
java.beans.IndexedPropertyDescriptor prop,
org.w3c.dom.Element parentElement)
Stores an indexed property (an array of properties) |
org.w3c.dom.Element |
storeObject(java.lang.String rootName,
java.lang.Object ob)
Stores a bean in an XML element and returns the element |
void |
storeObjectFields(java.lang.String xmlTagName,
java.lang.Object ob,
int writeType,
org.w3c.dom.Element parentElement)
Stores the properties of a bean as DOM Elements |
void |
storeProperty(java.lang.String xmlTagName,
java.lang.Object ob,
java.beans.PropertyDescriptor prop,
int writeType,
org.w3c.dom.Element parentElement)
Stores a non-indexed property |
void |
storePropertyValue(java.lang.String xmlTagName,
java.lang.Object propValue,
java.beans.PropertyDescriptor prop,
int writeType,
org.w3c.dom.Element parentElement)
Stores a property value based on the property type |
void |
storePropertyValueByType(java.lang.String xmlTagName,
java.lang.Object propValue,
java.beans.PropertyDescriptor prop,
int writeType,
org.w3c.dom.Element parentElement,
java.lang.Class type)
|
void |
storeString(java.lang.String xmlTagName,
java.lang.String propName,
java.lang.Object propValue,
int writeType,
org.w3c.dom.Element parentElement)
Writes out a string, using CDATA if the string contains < or & |
| Methods inherited from class com.wutka.jox.JOXBeanOutput |
expandChildElements,
getTranslatedChildName,
getTranslatedEntityName,
readDTD,
setupNameTranslation,
stripName,
writeAsAttribute,
writeBasicType,
writeDate,
writeIndexedProperty,
writeObject,
writeObjectFields,
writeProperty,
writePropertyValue,
writePropertyValueByType,
writeString |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected org.w3c.dom.Document document
protected static java.util.Hashtable beanCache
| Constructor Detail |
public JOXBeanDOM()
throws java.io.IOException
public JOXBeanDOM(org.w3c.dom.Document aDocument)
throws java.io.IOException
aDocument - The document to store the bean into
public JOXBeanDOM(java.lang.String dtdURL)
throws java.io.IOException
dtdURL - The URL of the DTD
public JOXBeanDOM(com.wutka.dtd.DTD aDTD)
throws java.io.IOException
dtdURL - The URL of the DTD
public JOXBeanDOM(org.w3c.dom.Document aDocument,
java.lang.String dtdURL)
throws java.io.IOException
dtdURL - The URL of the DTDaDocument - The XML document the bean will be stored in
public JOXBeanDOM(org.w3c.dom.Document aDocument,
com.wutka.dtd.DTD aDTD)
dtdURL - The URL of the DTDaDocument - The XML document the bean will be stored in
public JOXBeanDOM(boolean writeAttributesFlag)
throws java.io.IOException
writeAttributesFlag - True if simple properties should be stored as attributes
public JOXBeanDOM(org.w3c.dom.Document aDocument,
boolean writeAttributesFlag)
throws java.io.IOException
aDocument - The XML document the bean will be stored inwriteAttributesFlag - True if simple properties should be stored as attributes| Method Detail |
protected void createDocument()
throws java.io.IOException
public org.w3c.dom.Document beanToDocument(java.lang.String rootName,
java.lang.Object ob)
throws java.io.IOException
rootName - The name of the document's root tagob - The bean to store in the document
public org.w3c.dom.Element storeObject(java.lang.String rootName,
java.lang.Object ob)
throws java.io.IOException
rootName - The name of the element's tagob - The bean to store in the element
public void storeObjectFields(java.lang.String xmlTagName,
java.lang.Object ob,
int writeType,
org.w3c.dom.Element parentElement)
throws java.io.IOException
xmlTagName - The XML tag name of the bean being writtenob - The bean whose properties will be writtenwriteType - The kind of fields being written (attribute or element)
public void storeProperty(java.lang.String xmlTagName,
java.lang.Object ob,
java.beans.PropertyDescriptor prop,
int writeType,
org.w3c.dom.Element parentElement)
throws java.io.IOException
xmlTagName - The XML tag name of the bean being writtenob - The object containing the propertyprop - The property descriptor of the propertywriteType - Should we try to write this property
as an attribute? If not, don't write the object if
writeAttributes is true and this object can be written
as an attribute
public void storeIndexedProperty(java.lang.String xmlTagName,
java.lang.Object ob,
java.beans.IndexedPropertyDescriptor prop,
org.w3c.dom.Element parentElement)
throws java.io.IOException
xmlTagName - The XML tag name of the bean being writtenob - The object containing the propertyprop - The descriptor for the property
as an attribute? If not, don't write the object if
writeAttributes is true and this object can be written
as an attribute
public void storePropertyValue(java.lang.String xmlTagName,
java.lang.Object propValue,
java.beans.PropertyDescriptor prop,
int writeType,
org.w3c.dom.Element parentElement)
throws java.io.IOException
xmlTagName - The XML tag name of the bean being writtenpropValue - The value to writeprop - The property descriptor of the propertywriteType - Should we try to write this property
as an attribute? If not, don't write the object if
writeAttributes is true and this object can be written
as an attribute
public void storePropertyValueByType(java.lang.String xmlTagName,
java.lang.Object propValue,
java.beans.PropertyDescriptor prop,
int writeType,
org.w3c.dom.Element parentElement,
java.lang.Class type)
throws java.io.IOException
public void storeBasicType(java.lang.String xmlTagName,
java.lang.String propName,
java.lang.Object propValue,
int writeType,
org.w3c.dom.Element parentElement)
throws java.io.IOException
xmlTagName - The XML tag name of the bean being writtenpropName - The name of the property to writepropValue - The value of the property
public void storeString(java.lang.String xmlTagName,
java.lang.String propName,
java.lang.Object propValue,
int writeType,
org.w3c.dom.Element parentElement)
throws java.io.IOException
xmlTagName - The XML tag name of the bean being writtenpropName - The name of the property to writepropValue - The value of the propertyoutputStream - The output stream or writer where the value
is to be written
public void storeDate(java.lang.String xmlTagName,
java.lang.String propName,
java.lang.Object propValue,
int writeType,
org.w3c.dom.Element parentElement)
throws java.io.IOException
xmlTagName - The XML tag name of the bean being writtenpropName - The name of the property to writepropValue - The value of the propertyoutputStream - The output stream or writer where the value
is to be written
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||