Package org.apache.struts2.util.location
Class LocationAttributes.Pipe
java.lang.Object
org.apache.struts2.util.location.LocationAttributes.Pipe
- All Implemented Interfaces:
ContentHandler
- Enclosing class:
- LocationAttributes
A SAX filter that adds the information available from the
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.- See Also:
-
Constructor Summary
ConstructorDescriptionPipe()
Create a filter.Pipe
(ContentHandler next) Create a filter that is chained to another handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] arg0, int arg1, int arg2) void
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
void
startElement
(String uri, String loc, String raw, Attributes attrs) void
startPrefixMapping
(String arg0, String arg1) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
Pipe
public Pipe()Create a filter. It has to be chained to another handler to be really useful. -
Pipe
Create a filter that is chained to another handler.- Parameters:
next
- the next handler in the chain.
-
-
Method Details
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startElement
- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-