public class OAXMLWriter extends Object
OAXMLReader
Modifier and Type | Field and Description |
---|---|
protected Hashtable |
hash |
int |
indent |
int |
indentAmount |
protected PrintWriter |
pw |
static int |
WRITE_KEYONLY
param used to only write an object key
|
static int |
WRITE_NO
param used to not write an object
|
static int |
WRITE_NONEW_KEYONLY
param used to not write any new objects in a hub, so that Hub does not write new objects.
|
static int |
WRITE_YES
param used to write an object
|
Constructor and Description |
---|
OAXMLWriter(PrintWriter pw) |
OAXMLWriter(String fname) |
Modifier and Type | Method and Description |
---|---|
void |
addWillBeWriting(OAObject obj) |
void |
close() |
String |
convertToString(String property,
Object value)
Method that can be overwritten to provide custom conversion to String.
|
void |
end() |
protected void |
finalize() |
void |
flush() |
String |
getClassName(Class c) |
String |
getCurrentPropertyPath()
Shows the curret list of objects that are being saved.
|
String |
getEncodeMessage() |
boolean |
getIncludeEmptyHubs() |
boolean |
getIncludeNullProperties() |
boolean |
getIncludeOnlyImportMatchProperties() |
void |
indent() |
protected void |
init() |
void |
pop() |
void |
print(String line) |
void |
printCDATA(String line)
encloses line in XML CDATA tag and internally encodes illegal XML characters
|
void |
println(String line) |
void |
printXML(String line)
converts XML codes and encodes illegal XML characters
|
void |
push(String name)
Used internally when writing objects to show the objects that are being written.
|
void |
removeWillBeWriting(OAObject obj) |
void |
setEncodeMessage(String msg)
Used to encrypt all data.
|
void |
setFileName(String fname) |
void |
setIncludeEmptyHubs(boolean b) |
void |
setIncludeNullProperties(boolean b) |
void |
setIncludeOnlyImportMatchProperties(boolean b) |
void |
setIndentAmount(int x) |
void |
setPrintWriter(PrintWriter pw) |
int |
shouldWriteProperty(Object obj,
String propertyName,
Object value)
called by OAObject.write to know if object should
be written for a property that references another OAObject.
|
boolean |
willBeIncludedLater(OAObject oaObj)
returns true if this object will be included by another parent object.
|
void |
write(Hub hub)
saves Hub as XML
|
void |
write(OAObject obj)
saves OAObject as XML
|
int |
writeProperty(Object obj,
String propertyName,
Object value)
Deprecated.
|
void |
writing(Object obj)
hook used to know when an object is being saved.
|
protected PrintWriter pw
public int indent
public int indentAmount
public static final int WRITE_YES
public static final int WRITE_KEYONLY
public static final int WRITE_NO
public static final int WRITE_NONEW_KEYONLY
protected Hashtable hash
public OAXMLWriter(String fname)
public OAXMLWriter(PrintWriter pw)
public void setPrintWriter(PrintWriter pw)
public void setFileName(String fname)
public void setIncludeOnlyImportMatchProperties(boolean b)
public boolean getIncludeOnlyImportMatchProperties()
public void write(OAObject obj)
public void write(Hub hub)
public int writeProperty(Object obj, String propertyName, Object value)
shouldWriteProperty(Object, String, Object)
public int shouldWriteProperty(Object obj, String propertyName, Object value)
public void addWillBeWriting(OAObject obj)
public void removeWillBeWriting(OAObject obj)
public boolean willBeIncludedLater(OAObject oaObj)
public void writing(Object obj)
protected void finalize() throws Throwable
public void setIndentAmount(int x)
public void flush()
public void close()
public void end()
public void setEncodeMessage(String msg)
NOTE: currently only works with printCDATA. This needs to be changed so that all printXX methods encrypt data.
public String getEncodeMessage()
public void printCDATA(String line)
public void printXML(String line)
public void print(String line)
public void println(String line)
public void indent()
protected void init()
public String convertToString(String property, Object value)
public void setIncludeEmptyHubs(boolean b)
public boolean getIncludeEmptyHubs()
public void setIncludeNullProperties(boolean b)
public boolean getIncludeNullProperties()
public String getCurrentPropertyPath()
public void push(String name)
getCurrentPropertyPath()
public void pop()
Copyright © 1999–2019 ViaOA. All rights reserved.