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, warningprotected 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
Exceptionpublic Object read() throws Exception
Exceptionpublic Object parse() throws Exception
Exceptionprotected void reset()
public Object parse(String fileName) throws Exception
Exceptionpublic Object parseString(String xmlData) throws Exception
Exceptionpublic 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 ContentHandlerstartElement in class DefaultHandlerSAXExceptionpublic void endElement(String namespaceURI, String sName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionprotected void processProperty(String eName, String value, Class conversionClass, Hashtable hash)
public void characters(char[] buf,
int offset,
int len)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionpublic 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 ContentHandlerstartDocument in class DefaultHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionpublic OAObject createNewObject(Class c) throws Exception
Exceptionpublic Object convertToObject(String propertyName, String value, Class propertyClass)
protected Object getRealObject(OAObject object)
Copyright © 1999–2025 ViaOA. All rights reserved.