public class OAXMLReader1 extends DefaultHandler
OAXMLWriter
Modifier and Type | Field and Description |
---|---|
protected boolean |
bUseRef |
protected Class |
conversionClass |
protected Object |
firstObject |
protected HashMap |
hashGuid |
protected HashMap<Class,HashMap<OAObjectKey,OAObject>> |
hmMatch |
protected Object |
refValue |
protected Vector |
vecIncomplete |
protected Vector |
vecRemoved |
protected Vector |
vecRoot |
Constructor and Description |
---|
OAXMLReader1() |
OAXMLReader1(String fileName) |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] buf,
int offset,
int len)
SAXParser callback method.
|
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.
|
void |
endDocument()
SAXParser callback method.
|
void |
endElement(String namespaceURI,
String sName,
String qName)
SAXParser callback method.
|
void |
endObject(OAObject obj,
boolean hasParent)
Method that can be overwritten by subclass when an object is completed.
|
String |
getDecodeMessage() |
String |
getFileName() |
boolean |
getImportMatching() |
protected String |
getPropertyName(OAObject obj,
String propName) |
protected Object |
getRealObject(OAObject object)
By default, this will check to see if object already exists
in OAObjectCache and return that object.
|
Object[] |
getRootObjects()
Returns all root objects from last call to parse.
|
Object |
getValue(OAObject obj,
String name,
Object value)
Method that can be used to replace the value of an element/attribute.
|
Object |
parse()
Used to parse and create OAObjects from an XML file.
|
Object |
parse(String fileName)
Used to parse and create OAObjects from an XML file.
|
Object |
parseString(String xmlData)
Used to parse and create OAObjects from an XML string.
|
protected boolean |
processProperties(OAObject object,
Hashtable hash) |
protected void |
processProperty(String eName,
String value,
Class conversionClass,
Hashtable hash) |
Object |
read()
Used to parse and create OAObjects from an XML file.
|
Object |
read(String fileName)
Used to parse and create OAObjects from an XML file.
|
protected void |
reset() |
protected String |
resolveClassName(String className) |
void |
setDecodeMessage(String msg)
Used to unencrypt an XML file created by OAXMLWriter that used an encryption code.
|
void |
setFileName(String fileName) |
void |
setImportMatching(boolean b) |
void |
startDocument()
SAXParser callback method.
|
void |
startElement(String namespaceURI,
String sName,
String qName,
Attributes attrs)
SAXParser callback method.
|
void |
startHub(String className,
int total)
Method that can be overwritten by subclass to provide status of reader.
|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
protected boolean bUseRef
protected Object refValue
protected Object firstObject
protected Class conversionClass
protected Vector vecIncomplete
protected Vector vecRoot
protected HashMap hashGuid
protected HashMap<Class,HashMap<OAObjectKey,OAObject>> hmMatch
protected Vector vecRemoved
public OAXMLReader1()
public OAXMLReader1(String fileName)
public void setFileName(String fileName)
public String getFileName()
public void setImportMatching(boolean b)
public boolean getImportMatching()
public Object read(String fileName) throws Exception
Exception
public Object read() throws Exception
Exception
public Object parse() throws Exception
Exception
protected void reset()
public Object parse(String fileName) throws Exception
Exception
public Object parseString(String xmlData) throws Exception
Exception
public Object[] getRootObjects()
public void setDecodeMessage(String msg)
OAXMLWriter.setEncodeMessage(String)
public String getDecodeMessage()
public void startElement(String namespaceURI, String sName, String qName, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void endElement(String namespaceURI, String sName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
protected void processProperty(String eName, String value, Class conversionClass, Hashtable hash)
public void characters(char[] buf, int offset, int len) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public Object getValue(OAObject obj, String name, Object value)
public void startHub(String className, int total)
public void endObject(OAObject obj, boolean hasParent)
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
public OAObject createNewObject(Class c) throws Exception
Exception
public Object convertToObject(String propertyName, String value, Class propertyClass)
protected Object getRealObject(OAObject object)
Copyright © 1999–2019 ViaOA. All rights reserved.