Package net.sf.saxon.query
Class AnnotationList
java.lang.Object
net.sf.saxon.query.AnnotationList
- All Implemented Interfaces:
Iterable<Annotation>
An immutable list of function or variable annotations, or of annotation assertions
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
check
(Configuration config, String where) Check an annotation list for internal consistency (e.g.boolean
Filter the annotation list by the namespace URI part of the annotation nameget
(int i) Get the i'th annotation in the list (counting from zero)int
hashCode()
boolean
Ask whether a list of annotations contains an annotation with a given local nameboolean
includes
(StructuredQName name) Ask whether a list of annotations contains an annotation with a given nameboolean
isEmpty()
Ask whether the list of annotations is emptyiterator()
Returns an iterator over a set of elements of type T.static AnnotationList
singleton
(Annotation ann) Construct an annotation list containing a single annotationint
size()
The number of annotations in the listMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY
An empty annotation list
-
-
Constructor Details
-
AnnotationList
-
-
Method Details
-
singleton
Construct an annotation list containing a single annotation- Parameters:
ann
- the single annotation in the annotation list- Returns:
- a singleton annotation list
-
check
Check an annotation list for internal consistency (e.g. rules that %public and %private cannot coexist)- Parameters:
config
- the Saxon configurationwhere
- the context where the list appears: one of "DF" (declare function), "DV" (declare variable), "IF" (inline function declaration), "FT" (function test), "DI" (declare item-type)- Throws:
XPathException
- if the annotation list is not internally consistent
-
filterByNamespace
Filter the annotation list by the namespace URI part of the annotation name- Parameters:
ns
- the namespace URI required- Returns:
- an annotation list containing the subset of this annotation list where the annotation names have the required namespace
-
iterator
Returns an iterator over a set of elements of type T.- Specified by:
iterator
in interfaceIterable<Annotation>
- Returns:
- an Iterator.
-
isEmpty
public boolean isEmpty()Ask whether the list of annotations is empty- Returns:
- true if the list of annotations is empty
-
size
public int size()The number of annotations in the list- Returns:
- the number of annotations in the list of annotations
-
get
Get the i'th annotation in the list (counting from zero)- Parameters:
i
- the index of the required annotation (counting from zero)- Returns:
- the annotation at the specified position
-
includes
Ask whether a list of annotations contains an annotation with a given name- Parameters:
name
- the given name- Returns:
- true if one or more annotations with the given name are present in the list
-
includes
Ask whether a list of annotations contains an annotation with a given local name- Parameters:
localName
- the given local name- Returns:
- true if one or more annotations with the given name are present in the list
-
equals
-
hashCode
public int hashCode()
-