Package jadex.xml.writer
Class Writer
- java.lang.Object
- 
- jadex.xml.writer.AWriter
- 
- jadex.xml.writer.Writer
 
 
- 
 public class Writer extends AWriter XML writer for conversion of objects to XML.
- 
- 
Field SummaryFields Modifier and Type Field Description protected static javax.xml.stream.XMLOutputFactoryFACTORYThe xml output factory.protected booleangenidsControl flag for generating ids.protected booleanindentControl flag for generating indention.protected booleannewlineControl flag for generating newlines.- 
Fields inherited from class jadex.xml.writer.AWriterXML_INCLUDE_FIELDS
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.xml.stream.XMLStreamWritergetWriter(AWriteContext context)protected QName[]getXMLPath(java.util.List<StackElement> stack)Get the xml path for a stack.voidwrite(IObjectWriterHandler handler, java.lang.Object object, java.io.OutputStream out, java.lang.ClassLoader classloader, java.lang.Object context)Write the properties to an xml.voidwrite(IObjectWriterHandler handler, java.lang.Object object, java.lang.String encoding, java.io.OutputStream out, java.lang.ClassLoader classloader, java.lang.Object context)Write the properties to an xml.protected voidwriteEndObject(javax.xml.stream.XMLStreamWriter writer, int level)Write the end of an object.protected voidwriteIndentation(javax.xml.stream.XMLStreamWriter writer, int level)Write the indentation.protected voidwriteNewline(javax.xml.stream.XMLStreamWriter writer)protected voidwriteObject(WriteContextDesktop wc, java.lang.Object object, QName tag)Write an object to xml.protected voidwriteStartObject(javax.xml.stream.XMLStreamWriter writer, QName tag, int level)Write the start of an object.protected voidwriteSubobjects(WriteContextDesktop wc, TreeNode node, TypeInfo typeinfo)Write the subobjects of an object.- 
Methods inherited from class jadex.xml.writer.AWriterobjectToByteArray, objectToByteArray, objectToByteArray, objectToOutputStream, objectToXML, objectToXML
 
- 
 
- 
- 
- 
Field Detail- 
FACTORYprotected static final javax.xml.stream.XMLOutputFactory FACTORY The xml output factory.
 - 
genidsprotected boolean genids Control flag for generating ids.
 - 
indentprotected boolean indent Control flag for generating indention.
 - 
newlineprotected boolean newline Control flag for generating newlines.
 
- 
 - 
Constructor Detail- 
Writerpublic Writer() Create a new reader (with genids=true and indent=true).- Parameters:
- readerhandler- The handler.
 
 - 
Writerpublic Writer(boolean genids) Create a new reader (with genids=true and indent=true).- Parameters:
- readerhandler- The handler.
 
 - 
Writerpublic Writer(boolean genids, boolean indent, boolean newline)Create a new reader.- Parameters:
- readerhandler- The handler.
 
 
- 
 - 
Method Detail- 
writepublic void write(IObjectWriterHandler handler, java.lang.Object object, java.io.OutputStream out, java.lang.ClassLoader classloader, java.lang.Object context) throws java.lang.Exception Write the properties to an xml.
 - 
writepublic void write(IObjectWriterHandler handler, java.lang.Object object, java.lang.String encoding, java.io.OutputStream out, java.lang.ClassLoader classloader, java.lang.Object context) throws java.lang.Exception Write the properties to an xml.
 - 
writeObjectprotected void writeObject(WriteContextDesktop wc, java.lang.Object object, QName tag) throws java.lang.Exception Write an object to xml. Note: Must have tag parameter to support writing an object using an arbitrary tag. Cannot write tag in beforehand, because it must be written in one pass.- Throws:
- java.lang.Exception
 
 - 
writeSubobjectsprotected void writeSubobjects(WriteContextDesktop wc, TreeNode node, TypeInfo typeinfo) throws java.lang.Exception Write the subobjects of an object.- Throws:
- java.lang.Exception
 
 - 
writeStartObjectprotected void writeStartObject(javax.xml.stream.XMLStreamWriter writer, QName tag, int level) throws java.lang.ExceptionWrite the start of an object.- Throws:
- java.lang.Exception
 
 - 
writeEndObjectprotected void writeEndObject(javax.xml.stream.XMLStreamWriter writer, int level) throws java.lang.ExceptionWrite the end of an object.- Throws:
- java.lang.Exception
 
 - 
writeIndentationprotected void writeIndentation(javax.xml.stream.XMLStreamWriter writer, int level) throws java.lang.ExceptionWrite the indentation.- Throws:
- java.lang.Exception
 
 - 
writeNewlineprotected void writeNewline(javax.xml.stream.XMLStreamWriter writer) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
getXMLPathprotected QName[] getXMLPath(java.util.List<StackElement> stack) Get the xml path for a stack.- Parameters:
- stack- The stack.
- Returns:
- The string representig the xml stack (e.g. tag1/tag2/tag3)
 
 - 
getWriterpublic static javax.xml.stream.XMLStreamWriter getWriter(AWriteContext context) 
 
- 
 
-