|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.document.schema.impl.iterator.SchemaLevelNodeIteratorBuilder
public class SchemaLevelNodeIteratorBuilder
Simple builder for the SchemaLevelNodeIterator
object.
Introduces several useful methods for overriding builders.
Field Summary | |
---|---|
static ContentFilter |
FILTER_ACCEPT_ALL
Filter that accepts all pointer infos. |
Constructor Summary | |
---|---|
SchemaLevelNodeIteratorBuilder()
|
Method Summary | |
---|---|
protected static List<ContentInfo> |
computeItems(Node parent,
ContentFilter filter,
SortedSet<sk.baka.ikslibs.ptr.DOMPoint> forceIPs,
boolean lastEmptyItem)
Computes the list of items, that will be iterated. |
static SchemaLevelNodeIterator |
createIterator(Collection<ContentInfo> items)
Creates simple iterator iterating over given items. |
static SchemaLevelNodeIterator |
createIterator(Node parent,
boolean lastItemEmpty)
Creates simple iterator, with no force insertpoints and no filter. |
static SchemaLevelNodeIterator |
createIterator(Node parent,
sk.baka.ikslibs.ptr.DOMPoint ip,
ContentFilter filter)
Creates simple iterator, with last empty item. |
static SchemaLevelNodeIterator |
createIterator(Node parent,
SortedSet<sk.baka.ikslibs.ptr.DOMPoint> forceIPs,
ContentFilter filter,
boolean lastEmptyItem)
Creates instance of iterator, that walks over insertpoints of children of given element. |
static SchemaLevelNodeIterator |
createWithDeleted(sk.baka.ikslibs.interval.DOMInterval interval)
Pretends that there are nodes cut from the node sequence. |
static SchemaLevelNodeIterator |
createWithInserted(Element parent,
sk.baka.ikslibs.ptr.DOMPoint ip,
ContentInfo ci)
Pretends that there is given node inserted at given insertpoint. |
static SchemaLevelNodeIterator |
createWithInserted(Element parent,
sk.baka.ikslibs.ptr.DOMPoint ip,
List<ContentInfo> items)
Pretends that there is given node inserted at given insertpoint. |
static SchemaLevelNodeIterator |
createWithInserted(Element parent,
sk.baka.ikslibs.ptr.DOMPoint ip,
Node node)
Pretends that there is given node inserted at given insertpoint. |
static SchemaLevelNodeIterator |
createWithInserted(Element parent,
sk.baka.ikslibs.ptr.DOMPoint ip,
String text)
Pretends that there is some text inserted at given insertpoint. |
protected static void |
normalize(List<ContentInfo> items)
Normalizes the items by merging all adjacent text ContentInfo together. |
protected static int |
search(List<ContentInfo> list,
sk.baka.ikslibs.ptr.DomPointer ptr)
Search with given pointer in list of insertpoints. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ContentFilter FILTER_ACCEPT_ALL
Constructor Detail |
---|
public SchemaLevelNodeIteratorBuilder()
Method Detail |
---|
public static SchemaLevelNodeIterator createIterator(Node parent, boolean lastItemEmpty)
parent
- the node whose children have to be iterated.lastItemEmpty
- if true
then last item is a pointer that points
after the last node.
public static SchemaLevelNodeIterator createIterator(Node parent, sk.baka.ikslibs.ptr.DOMPoint ip, ContentFilter filter)
parent
- the node whose children have to be iterated.ip
- the one forced insert pointfilter
- the filter
public static SchemaLevelNodeIterator createIterator(Node parent, SortedSet<sk.baka.ikslibs.ptr.DOMPoint> forceIPs, ContentFilter filter, boolean lastEmptyItem)
parent
- iterates through insertpoints in children nodes of this
node.forceIPs
- forces these insertpoints to be part of insertpoints
returned by this iterator. If denotes CharacterData node, then iterator
acts if this text node was splitted into two adjacent chardata nodes with
this insertpoint inbetween them. Otherwise, it is ignored. It may be null
or an empty set - then it is ignored. All invalid forceIPs are
automatically deleted from the set.filter
- the node filter that is used by the
computeItems()
function to specify which nodes will occur
in the items
list. All Text
,
CDATASection
and Element
are reported to
this filter. If null
then the default filter, accepting
all nodes, is returned.lastEmptyItem
- if true then last item is a pointer that points
after the last node (if this ptrinfo is not rejected by the filter).
public static SchemaLevelNodeIterator createIterator(Collection<ContentInfo> items)
items
- collection of ContentInfo
.
protected static List<ContentInfo> computeItems(Node parent, ContentFilter filter, SortedSet<sk.baka.ikslibs.ptr.DOMPoint> forceIPs, boolean lastEmptyItem)
parent
- the parent node, may be element, document, entity and
document fragment.filter
- filter that filters out the nodes. All Text
,
CDATASection
and Element
are reported to
this filter. If null
then the default filter accepting all
nodes is used.forceIPs
- Forced insert points. It can be poin into the chardata
node - then the walker must act as if this cdata node was split into two
adjacent chardata nodes with this insertpoint inbetween them. It always
points into children of given parent - it can never point into contents
of entity reference node. May be null
- in such case no
force points are used.lastEmptyItem
- if true then last item is a pointer that points
ContentInfo
objects.protected static final int search(List<ContentInfo> list, sk.baka.ikslibs.ptr.DomPointer ptr)
list
- sorted list of contentinfosptr
- pointer to find.
Arrays.binarySearch(java.lang.Object[], java.lang.Object)
protected static void normalize(List<ContentInfo> items)
ContentInfo
together.
items
- list of ContentInfo
s.public static SchemaLevelNodeIterator createWithInserted(Element parent, sk.baka.ikslibs.ptr.DOMPoint ip, Node node)
parent
- the parent node where the node should be insertedip
- the point where the node must be insertednode
- the node that shall be inserted at given point
public static SchemaLevelNodeIterator createWithInserted(Element parent, sk.baka.ikslibs.ptr.DOMPoint ip, List<ContentInfo> items)
parent
- the parent node where the node should be insertedip
- the point where the node must be inserteditems
- list of ContentInfo
that shall be inserted at
given point. All pointers in this list must be equal to the
(parent, ip)
pointer.
public static SchemaLevelNodeIterator createWithInserted(Element parent, sk.baka.ikslibs.ptr.DOMPoint ip, ContentInfo ci)
parent
- the parent node where the node should be insertedip
- the point where the node must be insertedci
- the ContentInfo
instance that shall be inserted
at given point
public static SchemaLevelNodeIterator createWithInserted(Element parent, sk.baka.ikslibs.ptr.DOMPoint ip, String text)
parent
- the parent node where the node should be insertedip
- the point where the node must be insertedtext
- the text that shall be inserted at given position
public static SchemaLevelNodeIterator createWithDeleted(sk.baka.ikslibs.interval.DOMInterval interval)
interval
- the interval
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |