public class Stripper extends ProxyReceiver
Modifier and Type | Field and Description |
---|---|
static byte |
ALWAYS_PRESERVE |
static byte |
ALWAYS_STRIP |
static byte |
CANNOT_STRIP |
static byte |
PRESERVE_PARENT |
static byte |
STRIP_DEFAULT |
nextReceiver
pipelineConfiguration, previousAtomic, systemId
Modifier | Constructor and Description |
---|---|
protected |
Stripper()
Default constructor for use in subclasses
|
|
Stripper(Mode stripperRules)
create a Stripper and initialise variables
|
Modifier and Type | Method and Description |
---|---|
void |
attribute(int nameCode,
int typeCode,
java.lang.CharSequence value,
int locationId,
int properties)
Notify an attribute.
|
void |
characters(java.lang.CharSequence chars,
int locationId,
int properties)
Handle a text node
|
void |
endElement()
Handle an end-of-element event
|
Stripper |
getAnother()
Get a clean copy of this stripper
|
boolean |
getStripAll()
Determine if all whitespace is to be stripped (in this case, no further testing
is needed)
|
byte |
isSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element types
|
byte |
isSpacePreserving(NodeInfo element)
Decide whether an element is in the set of white-space preserving element types.
|
void |
open()
Callback interface for SAX: not for application use
|
void |
setPipelineConfiguration(PipelineConfiguration pipe)
Set the pipeline configuration
|
void |
setStripAll()
Specify that all whitespace nodes are to be stripped
|
void |
setXPathContext(XPathContext context)
Set the XPath context
|
void |
startElement(int nameCode,
int typeCode,
int locationId,
int properties)
Notify the start of an element
|
append, close, comment, endDocument, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument
getPipelineConfiguration, getSystemId
public static final byte ALWAYS_PRESERVE
public static final byte ALWAYS_STRIP
public static final byte STRIP_DEFAULT
public static final byte PRESERVE_PARENT
public static final byte CANNOT_STRIP
protected Stripper()
public Stripper(Mode stripperRules)
stripperRules
- defines which elements have whitespace stripped. If
null, all whitespace is preserved.public void setXPathContext(XPathContext context)
public Stripper getAnother()
public void setStripAll()
public boolean getStripAll()
public void setPipelineConfiguration(PipelineConfiguration pipe)
Receiver
setPipelineConfiguration
in interface Receiver
setPipelineConfiguration
in class ProxyReceiver
pipe
- the pipeline configurationpublic byte isSpacePreserving(int nameCode) throws XPathException
nameCode
- Identifies the name of the element whose whitespace is to
be preservedXPathException
public byte isSpacePreserving(NodeInfo element) throws XPathException
element
- Identifies the element whose whitespace is possibly to
be preservedXPathException
public void open() throws XPathException
open
in interface Receiver
open
in class ProxyReceiver
XPathException
public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException
ProxyReceiver
startElement
in interface Receiver
startElement
in class ProxyReceiver
nameCode
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool.locationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- properties of the element nodeXPathException
public void attribute(int nameCode, int typeCode, java.lang.CharSequence value, int locationId, int properties) throws XPathException
ProxyReceiver
attribute
in interface Receiver
attribute
in class ProxyReceiver
nameCode
- The name of the attribute, as held in the name pooltypeCode
- The type of the attribute, as held in the name poolvalue
- the string value of the attributelocationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- Bit significant value. The following bits are defined:
XPathException
public void endElement() throws XPathException
endElement
in interface Receiver
endElement
in class ProxyReceiver
XPathException
public void characters(java.lang.CharSequence chars, int locationId, int properties) throws XPathException
characters
in interface Receiver
characters
in class ProxyReceiver
chars
- The characterslocationId
- an integer which can be interpreted using a LocationProvider
to return information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- Bit significant value. The following bits are defined:
XPathException