public abstract class XMLHelper extends DefaultHandler implements EntityResolver
Modifier and Type | Field and Description |
---|---|
protected static int |
BOTH |
protected String |
curval
if set to other than null, characters will be stored here
|
protected static int |
ENDONLY |
protected Map |
m_call |
protected static int |
NOCALL |
protected String |
s_dtd |
protected String |
s_filename |
protected static int |
STARTONLY |
protected XMLReader |
xr |
Constructor and Description |
---|
XMLHelper() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addCall(String tag,
int id,
int constraint,
Map m_call,
CallMode mode) |
protected static void |
addCall(String tag,
int id,
int constraint,
Map m_call,
int callmode,
boolean readcontent)
Deprecated.
|
protected static void |
addCall(String tag,
int id,
Map m_call) |
protected static void |
addCall(String tag,
int id,
Map m_call,
CallMode mode) |
protected static void |
addCall(String tag,
int id,
Map m_call,
int callmode,
boolean readcontent)
Deprecated.
|
static void |
addEntity(String url,
String path) |
void |
characters(char[] ch,
int start,
int length)
if
curVal is not null, read characters will be appended there. |
protected void |
endElement(int id) |
void |
endElement(String uri,
String localName,
String qName) |
void |
error(SAXParseException e) |
protected static String |
getAttributeValueWithDefault(Attributes attr,
String key,
String defValue) |
ParsingWarningReport |
getWarnings()
Get the list of warning encountered during parsing if any.
|
InputSource |
resolveEntity(String publicId,
String systemId)
do the "entity resolver" job, a bit lazy, this needs some cleanups to become
more generalist, but it does the job for GINsim...
|
protected void |
startElement(int id,
Attributes attributes) |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
void |
startParsing(File file)
start parsing a file.
|
void |
startParsing(File file,
boolean b)
start parsing a file.
|
void |
startParsing(InputStream is) |
void |
startParsing(InputStream is,
boolean validating) |
void |
warning(SAXParseException e) |
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
protected static final int NOCALL
protected static final int ENDONLY
protected static final int STARTONLY
protected static final int BOTH
protected String curval
protected String s_dtd
protected String s_filename
protected XMLReader xr
protected Map m_call
@Deprecated protected static void addCall(String tag, int id, int constraint, Map m_call, int callmode, boolean readcontent)
protected static void addCall(String tag, int id, int constraint, Map m_call, CallMode mode)
@Deprecated protected static void addCall(String tag, int id, Map m_call, int callmode, boolean readcontent)
public void error(SAXParseException e) throws SAXException
error
in interface ErrorHandler
error
in class DefaultHandler
SAXException
public void warning(SAXParseException e) throws SAXException
warning
in interface ErrorHandler
warning
in class DefaultHandler
SAXException
public ParsingWarningReport getWarnings()
public void characters(char[] ch, int start, int length) throws SAXException
curVal
is not null, read characters will be appended there.
a bit less work for other implementors, they just have to set curVal to null or ""
when they need it.characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
ContentHandler.characters(char[], int, int)
public void startParsing(File file, boolean b) throws GsException
file
- b
- GsException
public void startParsing(File file) throws GsException
file
- GsException
public void startParsing(InputStream is) throws GsException
is
- GsException
public void startParsing(InputStream is, boolean validating) throws GsException
is
- validating
- GsException
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler
publicId
- systemId
- SAXException
protected static String getAttributeValueWithDefault(Attributes attr, String key, String defValue)
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
protected void startElement(int id, Attributes attributes)
protected void endElement(int id)
Copyright © 2005–2020. All rights reserved.