public abstract class AbstractDocumentFilter extends java.lang.Object implements DocumentFilterFactory
Document
filter implementation that does nothing.
It is meant to used as a base class for document filter subclasses.
Subclasses are exected to override findProperty(Document, String)
and/or getPropertyNames(Document)
, but not
newDocumentFilter(Document)
.Constructor and Description |
---|
AbstractDocumentFilter() |
Modifier and Type | Method and Description |
---|---|
Property |
findProperty(Document source,
java.lang.String name)
Finds a
Property by name . |
java.util.Set<java.lang.String> |
getPropertyNames(Document source)
|
java.util.List<Value> |
getPropertyValues(Document source,
java.lang.String name)
|
Document |
newDocumentFilter(Document source)
Returns a new
Document that acts as a filter for the
supplied source Document. |
java.lang.String |
toString() |
public Document newDocumentFilter(Document source) throws RepositoryException
DocumentFilterFactory
Document
that acts as a filter for the
supplied source
Document.newDocumentFilter
in interface DocumentFilterFactory
source
- the input Document
for the filter - must not be
null
RepositoryException
- if there was a problem accessing the sourcepublic Property findProperty(Document source, java.lang.String name) throws RepositoryException
Property
by name
. If the source
Document
has a property of that name, then that property
is returned.
Filter subclasses are likely to override this method.
source
- the source Document
for this filtername
- the name of the property to findnull
otherwiseRepositoryException
- if a repository access error occursRepositoryDocumentException
- if a document has fatal
processing errorspublic java.util.Set<java.lang.String> getPropertyNames(Document source) throws RepositoryException
Properties
in the
source
Document
.
Filter subclasses are likely to override this method.
source
- the source Document
for this filterRepositoryException
- if a repository access error occursRepositoryDocumentException
- if a document has fatal
processing errorspublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<Value> getPropertyValues(Document source, java.lang.String name) throws RepositoryException
Values
of the named Property
. Subclasses might make use of this
convenience method.source
- the source Document
for this filtername
- the name of the Property
whose values are to be
fetched.Values
of the named property, or an
empty list if the requested property does exist.RepositoryException
- if a repository access error occursRepositoryDocumentException
- if a document has fatal
processing errors