org::jdom::filter::ContentFilter Class Reference
Inheritance diagram for org::jdom::filter::ContentFilter:
List of all members.
Detailed Description
A general purpose Filter able to represent all legal JDOM objects or a specific subset. Filtering is accomplished by way of a filtering mask in which each bit represents whether a JDOM object is visible or not. For example to view all Text and CDATA nodes in the content of element x.
Filter filter = new ContentFilter(ContentFilter.TEXT |
ContentFilter.CDATA);
List content = x.getContent(filter);
For those who don't like bit-masking, set methods are provided as an alternative. For example to allow everything except Comment nodes.
Filter filter = new ContentFilter();
filter.setCommentVisible(false);
List content = x.getContent(filter);
The default is to allow all valid JDOM objects.
- Version:
- Revision
- 1.14
, - Date
- 2004/08/31 04:56:07
- Author:
- Bradley S. Huffman
Constructor & Destructor Documentation
org::jdom::filter::ContentFilter::ContentFilter |
( |
|
) |
[inline] |
|
|
Default constructor that allows any legal JDOM objects. |
org::jdom::filter::ContentFilter::ContentFilter |
( |
boolean |
allVisible |
) |
[inline] |
|
|
Set whether all JDOM objects are visible or not.
- Parameters:
-
| allVisible | true all JDOM objects are visible, false all JDOM objects are hidden. |
|
org::jdom::filter::ContentFilter::ContentFilter |
( |
int |
mask |
) |
[inline] |
|
|
Filter out JDOM objects according to a filtering mask.
- Parameters:
-
| mask | Mask of JDOM objects to allow. |
|
Member Function Documentation
boolean org::jdom::filter::ContentFilter::equals |
( |
Object |
obj |
) |
[inline] |
|
|
Returns whether the two filters are equivalent (i.e. the matching mask values are identical).
- Parameters:
-
| obj | the object to compare against |
- Returns:
- whether the two filters are equal
|
int org::jdom::filter::ContentFilter::getFilterMask |
( |
|
) |
[inline] |
|
|
Return current filtering mask.
- Returns:
- the current filtering mask
|
boolean org::jdom::filter::ContentFilter::matches |
( |
Object |
obj |
) |
[inline] |
|
|
Check to see if the object matches according to the filter mask.
- Parameters:
-
| obj | The object to verify. |
- Returns:
true if the objected matched a predfined set of rules.
Implements org::jdom::filter::Filter. |
void org::jdom::filter::ContentFilter::setCDATAVisible |
( |
boolean |
visible |
) |
[inline] |
|
|
Set visiblity of CDATA objects.
- Parameters:
-
| visible | whether CDATA nodes are visible, true if yes, false if not |
|
void org::jdom::filter::ContentFilter::setCommentVisible |
( |
boolean |
visible |
) |
[inline] |
|
|
Set visiblity of Comment objects.
- Parameters:
-
| visible | whether Comments are visible, true if yes, false if not |
|
void org::jdom::filter::ContentFilter::setDefaultMask |
( |
|
) |
[inline] |
|
|
Set this filter to allow all legal JDOM objects. |
void org::jdom::filter::ContentFilter::setDocTypeVisible |
( |
boolean |
visible |
) |
[inline] |
|
|
Set visiblity of DocType objects.
- Parameters:
-
| visible | whether the DocType is visible, true if yes, false if not |
|
void org::jdom::filter::ContentFilter::setDocumentContent |
( |
|
) |
[inline] |
|
|
Set filter to match only JDOM objects that are legal document content. |
void org::jdom::filter::ContentFilter::setElementContent |
( |
|
) |
[inline] |
|
|
Set filter to match only JDOM objects that are legal element content. |
void org::jdom::filter::ContentFilter::setElementVisible |
( |
boolean |
visible |
) |
[inline] |
|
|
Set visiblity of Element objects.
- Parameters:
-
| visible | whether Elements are visible, true if yes, false if not |
|
void org::jdom::filter::ContentFilter::setEntityRefVisible |
( |
boolean |
visible |
) |
[inline] |
|
|
Set visiblity of EntityRef objects.
- Parameters:
-
| visible | whether EntityRefs are visible, true if yes, false if not |
|
void org::jdom::filter::ContentFilter::setFilterMask |
( |
int |
mask |
) |
[inline] |
|
|
Set filtering mask.
- Parameters:
-
| mask | the new filtering mask |
|
void org::jdom::filter::ContentFilter::setPIVisible |
( |
boolean |
visible |
) |
[inline] |
|
|
Set visiblity of ProcessingInstruction objects.
- Parameters:
-
| visible | whether ProcessingInstructions are visible, true if yes, false if not |
|
void org::jdom::filter::ContentFilter::setTextVisible |
( |
boolean |
visible |
) |
[inline] |
|
|
Set visiblity of Text objects.
- Parameters:
-
| visible | whether Text nodes are visible, true if yes, false if not |
|
Member Data Documentation
|
Mask for JDOM CDATA objects |
|
Mask for JDOM Text objects |
The documentation for this class was generated from the following file:
- src/java/org/jdom/filter/ContentFilter.java
Generated on Thu Dec 9 10:42:05 2004 for JDOM by
1.3.9.1