The ConverterParser is a filtering proxy implementation that uses the
mappings defined in this package to modify the parsed attribute values
on the fly into the new values.
| Method from org.jfree.report.modules.gui.converter.parser.ConverterParser Detail: |
public void characters(char[] chars,
int start,
int length) throws SAXException {
base.characters(chars, start, length);
}
Receive notification of character data inside an element.
Forwards the event to the base parser implementation. |
public void endDocument() throws SAXException {
base.endDocument();
}
Receive notification of the end of the document.
Forwards the event to the base parser implementation. |
public void endElement(String uri,
String localName,
String qName) throws SAXException {
currentContext.pop();
base.endElement(uri, localName, qName);
}
Receive notification of the end of the document.
Updates the context and forwards the event to the base parser. |
public void error(SAXParseException exception) throws SAXException {
base.error(exception);
}
Receive notification of a recoverable error.
This corresponds to the definition of "error" in section 1.2
of the W3C XML 1.0 Recommendation. For example, a validating
parser would use this callback to report the violation of a
validity constraint. The default behaviour is to take no
action.
The SAX parser must continue to provide normal parsing events
after invoking this method: it should still be possible for the
application to process the document through to the end. If the
application cannot do so, then the parser should report a fatal
error even if the XML 1.0 recommendation does not require it to
do so.
Filters may use this method to report other, non-XML errors
as well. |
public void fatalError(SAXParseException exception) throws SAXException {
base.fatalError(exception);
}
Receive notification of a non-recoverable error.
This corresponds to the definition of "fatal error" in
section 1.2 of the W3C XML 1.0 Recommendation. For example, a
parser would use this callback to report the violation of a
well-formedness constraint.
The application must assume that the document is unusable
after the parser has invoked this method, and should continue
(if at all) only for the sake of collecting addition error
messages: in fact, SAX parsers are free to stop reporting any
other events once this method has been invoked. |
public String getConfigProperty(String key) {
return base.getConfigProperty(key);
}
Returns the configuration property with the specified key. |
public String getConfigProperty(String key,
String defaultValue) {
return base.getConfigProperty(key, defaultValue);
}
Returns the configuration property with the specified key (or the specified default value
if there is no such property).
If the property is not defined in this configuration, the code will lookup the property in
the parent configuration. |
public Object getHelperObject(String key) {
return base.getHelperObject(key);
}
|
public ElementDefinitionHandler getInitialFactory() {
return base.getInitialFactory();
}
Returns the initial handler. |
public Parser getInstance() {
return new ConverterParser(base);
}
Returns a new instance of the parser. |
public Locator getLocator() {
return base.getLocator();
}
Returns the current locator. |
public Object getResult() {
return base.getResult();
}
|
public void notationDecl(String name,
String publicId,
String systemId) throws SAXException {
base.notationDecl(name, publicId, systemId);
}
Receive notification of a notation declaration event.
It is up to the application to record the notation for later
reference, if necessary.
At least one of publicId and systemId must be non-null.
If a system identifier is present, and it is a URL, the SAX
parser must resolve it fully before passing it to the
application through this event.
There is no guarantee that the notation declaration will be
reported before any unparsed entities that use it. |
public ElementDefinitionHandler peekFactory() {
return base.peekFactory();
}
Reads a handler off the stack without removing it. |
public ElementDefinitionHandler popFactory() {
return base.popFactory();
}
Pops a handler from the stack. |
public void pushFactory(ElementDefinitionHandler elementDefinitionHandler) {
base.pushFactory(elementDefinitionHandler);
}
Pushes a handler onto the stack. |
public InputSource resolveEntity(String publicId,
String systemId) throws SAXException {
try
{
return base.resolveEntity(publicId, systemId);
}
catch (Exception oe)
{
// this one drives me crazy, in JDK 1.4 the IOException
// is not defined, but in the official SAX sources it is
// defined. Now depending on which version you compile it
// gives an differen error. I HATE THIS!
throw new SAXException(oe);
}
}
Allow the application to resolve external entities.
The Parser will call this method before opening any external
entity except the top-level document entity (including the
external DTD subset, external entities referenced within the
DTD, and external entities referenced within the document
element): the application may request that the parser resolve
the entity itself, that it use an alternative URI, or that it
use an entirely different input source.
If the system identifier is a URL, the SAX parser must
resolve it fully before reporting it to the application.
The official SAX implementation declares that it also throws an
IOException, while the JDK1.4 SAX2 implementation doesn't.
We catch all exceptions here and map them into the SAXException
to resolve that issue. |
public void setConfigProperty(String key,
String value) {
base.setConfigProperty(key, value);
}
Sets a parser configuration value. |
public void setDocumentLocator(Locator locator) {
base.setDocumentLocator(locator);
}
Receive an object for locating the origin of SAX document events.
The locator allows the application to determine the end position of
any document-related event, even if the parser is not reporting an
error. Typically, the application will use this information for
reporting its own errors (such as character content that does not
match an application's business rules). The information returned by
the locator is probably not sufficient for use with a search engine. |
public void setHelperObject(String key,
Object value) {
base.setHelperObject(key, value);
}
|
public void setInitialFactory(ElementDefinitionHandler elementDefinitionHandler) {
base.setInitialFactory(elementDefinitionHandler);
}
Sets the initial handler. |
public void startDocument() throws SAXException {
base.startDocument();
}
Receive notification of the beginning of the document.
Forwards the event to the base parser implementation. |
public void startElement(String uri,
String localName,
String qName,
Attributes attributes) throws SAXException {
TranslationTableFactory.ContextRule rule = null;
if (currentContext.isEmpty() == false)
{
final Object o = currentContext.peek();
if (o instanceof TranslationTableFactory.ContextRule)
{
rule = (TranslationTableFactory.ContextRule) o;
}
}
rule = TranslationTableFactory.getInstance().buildContext(rule, qName);
if (rule == null)
{
// do not translate ..
currentContext.push(qName);
base.startElement(uri, localName, qName, attributes);
}
else
{
// do translate ..
currentContext.push(rule);
final TranslationTable table =
TranslationTableFactory.getInstance().getTranslationTable(rule);
base.startElement(uri, localName, qName, new ConverterAttributes(attributes, table));
}
}
Receive notification of the start of an element.
Updates the context and forwards the event to the base parser. |
public void unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName) throws SAXException {
base.unparsedEntityDecl(name, publicId, systemId, notationName);
}
Receive notification of an unparsed entity declaration event.
Note that the notation name corresponds to a notation
reported by the notationDecl event.
It is up to the application to record the entity for later
reference, if necessary.
If the system identifier is a URL, the parser must resolve it
fully before passing it to the application. |
public void warning(SAXParseException exception) throws SAXException {
base.warning(exception);
}
Receive notification of a warning.
SAX parsers will use this method to report conditions that
are not errors or fatal errors as defined by the XML 1.0
recommendation. The default behaviour is to take no action.
The SAX parser must continue to provide normal parsing events
after invoking this method: it should still be possible for the
application to process the document through to the end.
Filters may use this method to report other, non-XML warnings
as well. |