Using the StAXStreamBuilder or StAXEventBuilder you can parse a List of JDOM content by filtering that content with an instance of this filter.
There are two significant states in which methods in this interface will be called:
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: null if you want to exclude this CDATA, or a non-null value which will become the new CDATA text value.The depth of this content from the document root
(the root Element is at depth 0) depth, String The CDATA text value text)The current event is a CDATA event. |
| public String | Returns: null if you want to exclude this comment, or a non-null value which will become the new comment value.The depth of this content from the document root
(the root Element is at depth 0) depth, String The Comment value comment)The current event is a Comment event. |
| public boolean | Returns: true if the DocType should become a JDOM Fragment.The current event is a DocType event. |
| public boolean | Returns: true if the Element should become a JDOM Fragment.The depth of this content from the document root
(the root Element is at depth 0) depth, String The XML tag name of this Element name, Namespace The Namespace of this Element ns)The current event is an Element event. |
| public boolean | Returns: true if you want to include this EntityRef.The depth of this content from the document root
(the root Element is at depth 0) depth, String The EntityRef name name)The current event is an EntityRef event. |
| public boolean | Returns: true if you want to include this ProcessingInstruction.The depth of this content from the document root
(the root Element is at depth 0) depth, String The ProcessingInstruction Target value target)The current event is a ProcessingInstruction event. |
| public String | Returns: null if you want to exclude this Text, or a non-null value which will become the new Text value.The depth of this content from the document root
(the root Element is at depth 0) depth, String The Text value text)The current event is a TEXT event. |
| public String | Returns: null if you want to exclude this CDATA, or a non-null value which will become the new CDATA text value.The depth of this content from the document root
(the root Element is at depth 0) depth, String The CDATA text value text)An Element is being included, and this is a child CDATA event of the included parent Element. |
| public String | Returns: null if you want to exclude this Comment, or a non-null value which will become the new Comment value.The depth of this content from the document root
(the root Element is at depth 0) depth, String The Comment value comment)An Element is being included, and this is a child Comment event of the included parent Element. |
| public boolean | Returns: true if the child Element should be excluded.The depth of this content from the document root
(the root Element is at depth 0) depth, String The XML tag name of this child Element name, Namespace The Namespace of this child Element ns)An Element is being included, and this is a child Element event of the included parent Element. |
| public boolean | Returns: true if you want to exclude this EntityRef.The depth of this content from the document root
(the root Element is at depth 0) depth, String The EntityRef name name)An Element is being included, and this is a child EntityRef event of the included parent Element. |
| public boolean | Returns: true if you want to exclude this ProcessingInstruction.The depth of this content from the document root
(the root Element is at depth 0) depth, String The ProcessingInstruction Target value target)An Element is being included, and this is a child ProcessingInstruction event of the included parent Element. |
| public String | Returns: null if you want to exclude this Text, or a non-null value which will become the new Text value.The depth of this content from the document root
(the root Element is at depth 0) depth, String The Text value text)An Element is being included, and this is a child Text event of the included parent Element. |
| includeCDATA | back to summary |
|---|---|
| public String includeCDATA(int depth, String text) 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(int depth, String comment) 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() The current event is a DocType event.
| |
| includeElement | back to summary |
|---|---|
| public boolean includeElement(int depth, String name, Namespace ns) 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(int depth, String name) The current event is an EntityRef event.
| |
| includeProcessingInstruction | back to summary |
|---|---|
| public boolean includeProcessingInstruction(int depth, String target) The current event is a ProcessingInstruction event.
| |
| includeText | back to summary |
|---|---|
| public String includeText(int depth, String text) 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(int depth, String text) 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(int depth, String comment) 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(int depth, String name, Namespace ns) 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(int depth, String name) 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(int depth, String target) 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(int depth, String text) 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;
}
| |