Package com.pd4ml.pdf.xfdf.internal
Class SelectionFilter
- java.lang.Object
-
- com.pd4ml.pdf.xfdf.internal.SelectionFilter
-
public final class SelectionFilter extends java.lang.ObjectThe optional "which annotations/fields" narrowing bothXfdfExporterandXfdfImporteraccept: a type filter and an ID filter, either or both of which may be unset (meaning "no restriction" for that one).- Type -- an annotation's XFDF element name (e.g.
"square","freetext"; matchesXfdfAnnotation.getType()) or a field's PDF/FTcode ("Tx","Btn","Ch","Sig") -- always compared case-insensitively. The two vocabularies don't overlap, so one comma-separated list naturally selects from both at once, e.g."square,circle,tx"keeps only Square/Circle annotations and text fields. - ID -- an annotation's own
/NMor a field's fully-qualified name, compared exactly (case-sensitively, since both are exact PDF identifiers, not free text) -- the same combined-list reasoning applies.
- Type -- an annotation's XFDF element name (e.g.
-
-
Field Summary
Fields Modifier and Type Field Description static SelectionFilterNONEMatches everything -- the default when neithertypesnoridsis configured.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasIdFilter()trueif this filter restricts by ID at all.booleanhasTypeFilter()trueif this filter restricts by type at all -- lets a caller skip work it wouldn't need otherwise.booleanincludes(java.lang.String type, java.lang.String id)static SelectionFilterof(java.lang.String typesCsv, java.lang.String idsCsv)
-
-
-
Field Detail
-
NONE
public static final SelectionFilter NONE
Matches everything -- the default when neithertypesnoridsis configured.
-
-
Method Detail
-
of
public static SelectionFilter of(java.lang.String typesCsv, java.lang.String idsCsv)
- Parameters:
typesCsv- comma-separated type tokens, ornull/blank for no type restrictionidsCsv- comma-separated/NM/field-name tokens, ornull/blank for no ID restriction
-
hasTypeFilter
public boolean hasTypeFilter()
trueif this filter restricts by type at all -- lets a caller skip work it wouldn't need otherwise.
-
hasIdFilter
public boolean hasIdFilter()
trueif this filter restricts by ID at all.
-
includes
public boolean includes(java.lang.String type, java.lang.String id)- Parameters:
type- the item's type token (an XFDF annotation type or a field's/FTcode); nevernullid- the item's/NMor fully-qualified field name, ornullif it has none
-
-