public class OAXMLReader extends Object
OAXMLWriter| Modifier and Type | Field and Description |
|---|---|
protected boolean |
bWithinTag |
protected Class |
conversionClass |
boolean |
debug |
protected HashMap<String,OAObject> |
hashGuid |
protected int |
indent |
protected Object[] |
stack |
protected int |
total |
protected String |
value |
| Constructor and Description |
|---|
OAXMLReader() |
| Modifier and Type | Method and Description |
|---|---|
protected ArrayList<Object> |
_process() |
protected OAObject |
_processChildren(HashMap<String,Object> hm,
Class<? extends OAObject> toClass,
boolean bIsPreloading,
int level) |
protected Object |
_processRoot(String key,
HashMap<String,Object> hm,
boolean bIsPreloading) |
protected void |
afterLoadObject(OAObject obj,
HashMap<String,Object> hm) |
protected void |
beforeLoadObject(OAObject obj,
HashMap<String,Object> hm) |
protected void |
characters(char[] buf,
int offset,
int len) |
Object |
convertToObject(String propertyName,
String value,
Class propertyClass)
Convert from String to correct type.
|
OAObject |
createNewObject(Class c)
Method that can be overwritten by subclass to create a new Object for a specific Class.
|
protected void |
endDocument() |
protected void |
endElement(String namespaceURI,
String sName,
String qName) |
protected void |
endObject(OAObject obj,
boolean hasParent)
Method that can be overwritten by subclass when an object is completed.
|
String |
getDecodeMessage() |
protected DefaultHandler |
getDefaultHandler() |
boolean |
getImportMatching() |
protected OAObject |
getObject(Class toClass,
HashMap<String,Object> hm)
Called before creating and loading a new object.
|
protected String |
getPropertyName(OAObject obj,
String propName) |
protected OAObject |
getRealObject(OAObject object) |
Object |
getValue(OAObject obj,
String name,
Object value)
Method that can be used to replace the value of an element/attribute.
|
static void |
main(String[] args) |
protected void |
parseFile(String fileName) |
void |
parseString(String xmlData) |
protected ArrayList |
process() |
Object[] |
read(File file) |
Object[] |
readFile(String fileName)
Read the xml data from a file and load into objects.
|
Object[] |
readXML(String xmlText)
Read the xml data and load into objects.
|
protected void |
reset() |
protected String |
resolveClassName(String className)
This can be overwritten to change/expand a class name
|
void |
setDecodeMessage(String msg)
Used to unencrypt an XML file created by OAXMLWriter that used an encryption code.
|
void |
setImportMatching(boolean b) |
protected void |
startDocument() |
protected void |
startElement(String namespaceURI,
String sName,
String qName,
Attributes attrs) |
protected String value
protected int indent
protected int total
protected boolean bWithinTag
protected Object[] stack
protected Class conversionClass
public boolean debug
public Object[] readFile(String fileName) throws Exception
Exceptionpublic Object[] readXML(String xmlText) throws Exception
Exceptionpublic void setImportMatching(boolean b)
public boolean getImportMatching()
public void setDecodeMessage(String msg)
OAXMLWriter.setEncodeMessage(String)public String getDecodeMessage()
protected void reset()
protected Object _processRoot(String key, HashMap<String,Object> hm, boolean bIsPreloading) throws Exception
Exceptionprotected OAObject _processChildren(HashMap<String,Object> hm, Class<? extends OAObject> toClass, boolean bIsPreloading, int level) throws Exception
Exceptionprotected void startElement(String namespaceURI, String sName, String qName, Attributes attrs) throws SAXException
SAXExceptionprotected void endElement(String namespaceURI, String sName, String qName) throws SAXException
SAXExceptionprotected void characters(char[] buf,
int offset,
int len)
throws SAXException
SAXExceptionpublic Object getValue(OAObject obj, String name, Object value)
protected void startDocument()
throws SAXException
SAXExceptionprotected void endDocument()
throws SAXException
SAXExceptionpublic OAObject createNewObject(Class c) throws Exception
Exceptionpublic Object convertToObject(String propertyName, String value, Class propertyClass)
protected OAObject getObject(Class toClass, HashMap<String,Object> hm)
toClass - type of object to createhm - name/value, where name is uppercase.protected void endObject(OAObject obj, boolean hasParent)
protected String resolveClassName(String className)
protected DefaultHandler getDefaultHandler()
Copyright © 1999–2025 ViaOA. All rights reserved.