Override this class to make adjustments to get the results you need.
StAXFilter
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | includeCDATA(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The CDATA text value text)Implements org. |
| public String | includeComment(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The Comment value comment)Implements org. |
| public boolean | includeDocType()
Implements org. |
| public boolean | includeElement(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The XML tag name of this Element name, final Namespace The Namespace of this Element ns)Implements org. |
| public boolean | includeEntityRef(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The EntityRef name name)Implements org. |
| public boolean | includeProcessingInstruction(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The ProcessingInstruction Target value target)Implements org. |
| public String | includeText(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The Text value text)Implements org. |
| public String | pruneCDATA(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The CDATA text value text)Implements org. |
| public String | pruneComment(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The Comment value comment)Implements org. |
| public boolean | pruneElement(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The XML tag name of this child Element name, final Namespace The Namespace of this child Element ns)Implements org. |
| public boolean | pruneEntityRef(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The EntityRef name name)Implements org. |
| public boolean | pruneProcessingInstruction(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The ProcessingInstruction Target value target)Implements org. |
| public String | pruneText(final int
The depth of this content from the document root
(the root Element is at depth 0) depth, final String The Text value text)Implements org. |
| DefaultStAXFilter | back to summary |
|---|---|
| public DefaultStAXFilter() | |
| includeCDATA | back to summary |
|---|---|
| public String includeCDATA(final int depth, final String text) Implements org. Doc from org. The current event is a CDATA event. A null return value will cause the Comment to be ignored, and a non-null return value will become the CDATA's text.
To include the CDATA as-is, do:
public String includeCDATA(int depth, String text) {
return text;
}
| |
| includeComment | back to summary |
|---|---|
| public String includeComment(final int depth, final String comment) Implements org. Doc from org. The current event is a Comment event. A null return value will cause the Comment to be ignored, and a non-null return value will become the Comment's text.
To include the comment as-is, do:
public String includeComment(int depth, String comment) {
return comment;
}
| |
| includeDocType | back to summary |
|---|---|
| public boolean includeDocType() Implements org. Doc from org. The current event is a DocType event.
| |
| includeElement | back to summary |
|---|---|
| public boolean includeElement(final int depth, final String name, final Namespace ns) Implements org. Doc from org. The current event is an Element event. If the return value of this call is true, then this Element will be processed as a JDOM fragment. You may then get calls to the prune* methods to determine whether child content of this Element should be pruned. | |
| includeEntityRef | back to summary |
|---|---|
| public boolean includeEntityRef(final int depth, final String name) Implements org. Doc from org. The current event is an EntityRef event.
| |
| includeProcessingInstruction | back to summary |
|---|---|
| public boolean includeProcessingInstruction(final int depth, final String target) Implements org. Doc from org. The current event is a ProcessingInstruction event.
| |
| includeText | back to summary |
|---|---|
| public String includeText(final int depth, final String text) Implements org. Doc from org. The current event is a TEXT event. A null return value will cause the Comment to be ignored, and a non-null return value will become the Text's text.
To include the Text as-is, do:
public String includeText(int depth, String text) {
return text;
}
| |
| pruneCDATA | back to summary |
|---|---|
| public String pruneCDATA(final int depth, final String text) Implements org. Doc from org. An Element is being included, and this is a child CDATA event of the included parent Element. Should this child CDATA be pruned from the parent fragment? A non-null return value will become the CDATA text. Return null to skip the CDATA.
To include the CDATA as-is, do:
public String pruneCDATA(int depth, String text) {
return text;
}
| |
| pruneComment | back to summary |
|---|---|
| public String pruneComment(final int depth, final String comment) Implements org. Doc from org. An Element is being included, and this is a child Comment event of the included parent Element. Should this child Comment be pruned from the parent fragment? A non-null return value will become the Comment value. Return null to skip the Comment.
To include the Comment as-is, do:
public String pruneComment(int depth, String comment) {
return comment;
}
| |
| pruneElement | back to summary |
|---|---|
| public boolean pruneElement(final int depth, final String name, final Namespace ns) Implements org. Doc from org. An Element is being included, and this is a child Element event of the included parent Element. Should this Child Element be pruned from the parent fragment? | |
| pruneEntityRef | back to summary |
|---|---|
| public boolean pruneEntityRef(final int depth, final String name) Implements org. Doc from org. An Element is being included, and this is a child EntityRef event of the included parent Element. Should this child EntityRef be pruned from the parent fragment?
| |
| pruneProcessingInstruction | back to summary |
|---|---|
| public boolean pruneProcessingInstruction(final int depth, final String target) Implements org. Doc from org. An Element is being included, and this is a child ProcessingInstruction event of the included parent Element. Should this ProcessingInstruction be pruned from the parent fragment?
| |
| pruneText | back to summary |
|---|---|
| public String pruneText(final int depth, final String text) Implements org. Doc from org. An Element is being included, and this is a child Text event of the included parent Element. Should this child Text be pruned from the parent fragment? A non-null return value will become the Text. Return null to skip the Text.
To include the Text as-is, do:
public String pruneText(int depth, String text) {
return text;
}
| |