public static class LocationAttributes.Pipe extends Object implements ContentHandler
Locator as attributes.
The purpose of having location as attributes is to allow this information to survive transformations
of the document (an XSL could copy these attributes over) or conversion of SAX events to a DOM.
The location is added as 3 attributes in a specific namespace to each element.
<root xmlns:loc="http://opensymphony.com/xwork/location"
loc:src="file://path/to/file.xml"
loc:line="1" loc:column="1">
<foo loc:src="file://path/to/file.xml" loc:line="2" loc:column="3"/>
</root>
Note: Although this adds a lot of information to the serialized form of the document,
the overhead in SAX events is not that big, as attribute names are interned, and all src
attributes point to the same string.LocationAttributes| Constructor and Description |
|---|
LocationAttributes.Pipe()
Create a filter.
|
LocationAttributes.Pipe(ContentHandler next)
Create a filter that is chained to another handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] arg0,
int arg1,
int arg2) |
void |
endDocument() |
void |
endElement(String arg0,
String arg1,
String arg2) |
void |
endPrefixMapping(String arg0) |
void |
ignorableWhitespace(char[] arg0,
int arg1,
int arg2) |
void |
processingInstruction(String arg0,
String arg1) |
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String arg0) |
void |
startDocument() |
void |
startElement(String uri,
String loc,
String raw,
Attributes attrs) |
void |
startPrefixMapping(String arg0,
String arg1) |
public LocationAttributes.Pipe()
public LocationAttributes.Pipe(ContentHandler next)
next - the next handler in the chain.public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionpublic void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
startElement in interface ContentHandlerSAXExceptionpublic void endElement(String arg0, String arg1, String arg2) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void startPrefixMapping(String arg0, String arg1) throws SAXException
startPrefixMapping in interface ContentHandlerSAXExceptionpublic void endPrefixMapping(String arg0) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void characters(char[] arg0,
int arg1,
int arg2)
throws SAXException
characters in interface ContentHandlerSAXExceptionpublic void ignorableWhitespace(char[] arg0,
int arg1,
int arg2)
throws SAXException
ignorableWhitespace in interface ContentHandlerSAXExceptionpublic void processingInstruction(String arg0, String arg1) throws SAXException
processingInstruction in interface ContentHandlerSAXExceptionpublic void skippedEntity(String arg0) throws SAXException
skippedEntity in interface ContentHandlerSAXExceptionCopyright © 2000–2016 Apache Software Foundation. All rights reserved.