|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.document.DomPointerFactory
public final class DomPointerFactory
Creates pointer into contents of document, from various parameters.
You can do following with the pointer:
ip
component and use it to modify
document.PTR_INSERT_ELEMENT
flag - use schema functions instead.pointsTo
or beforePoints
is node of this type,
then newly created text will be merged with adjacent node with same type.
Thus, you modified this node, instead of creating a new one. Use the
createsText
function to query, if you'll be really creating
new text node, or just modifying the adjacent one. After creating or
modifying text, you must check the validity of this new text.
Constructor Summary | |
---|---|
DomPointerFactory()
Constructs instance of factory with doc parameter set to null. |
|
DomPointerFactory(DomCore doc)
Constructs instance of factory. |
Method Summary | |
---|---|
DomPointer |
create(Node pointsTo)
Creates instance of pointer. |
DomPointer |
create(Node parent,
InsertPoint ip)
Creates instance of pointer. |
DomPointer |
create(Node pointsTo,
int pos)
Creates instance of pointer. |
DomPointer |
create(Node parent,
Node pointsTo)
Creates instance of pointer. |
DomPointer |
create(Node parent,
Node pointsTo,
int pos)
Creates instance of pointer. |
DomPointer |
create(String pointsToId)
Creates instance of pointer. |
DomPointer |
create(String parentId,
InsertPoint ip)
Creates instance of pointer. |
DomPointer |
create(String parentId,
String pointsToId)
Creates instance of pointer. |
DomPointer |
createFirstIn(Node parent,
EnumSet<DomPointerFlag> flags)
Creates a pointer that points onto a first 'child' of given element (a child when entity references are resolved. |
DomPointer |
getFirst(EnumSet<DomPointerFlag> ptrFlags)
Returns first pointer with given flags, in the Document-order ordering. |
DomPointer |
getLast(EnumSet<DomPointerFlag> ptrFlags)
Returns last pointer with given flags, in the Document-order ordering. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
DomPointerFactory(DomCore doc)
doc
- document, where all produced pointers will point. It may be
null
: then pointers created will have all IDs and rules
null.public DomPointerFactory()
Method Detail |
---|
public DomPointer create(Node parent, InsertPoint ip)
parent
- parent element. Pointer will point into its contents.ip
- insertpoint, where the pointer points.
public DomPointer create(String parentId, InsertPoint ip) throws DocumentException
parentId
- id of parent element. Pointer will point into its
contents.ip
- insertpoint, where the pointer points.
DocumentException
- if id doesn't exist.public DomPointer create(Node parent, Node pointsTo)
parent
- parent element. Pointer will point into its contents.pointsTo
- the pointer will point onto this node. However, pointer
points between the nodes, thus it will point right before this node. If
null, then pointer will point at end of node sequence.
public DomPointer create(Node parent, Node pointsTo, int pos)
parent
- parent element. Pointer will point into its contents.pointsTo
- the pointer will point onto this node. However, pointer
points between the nodes, thus it will point right before this node. If
null, then pointer will point at end of node sequence.pos
- if the pointsTo
node denotes a text or cdata
node then pos can specify the position of the character where the pointer
shall point. Otherwise it must be zero.
public DomPointer create(String parentId, String pointsToId) throws DocumentException
parentId
- parent element. Pointer will point into its contents. You
may obtain the parent node by the getParentId()
functionpointsToId
- the pointer will point onto this node. However, pointer
points between the nodes, thus it will point right before this node. If
null
, then pointer will point at end of node sequence.
The pointer must not denote an attribute node.
DocumentException
- if id doesn't exist.public DomPointer create(String pointsToId) throws DocumentException
pointsToId
- the pointer will point onto this node. However, pointer
points between the nodes, thus it will point right before this node. It
must not be null
nor an attribute node.
DocumentException
- if id doesn't exist.public DomPointer create(Node pointsTo)
pointsTo
- the pointer will point onto this node. However, pointer
points between the nodes, thus it will point right before this node. It
must not be null
nor an attribute node.
public DomPointer create(Node pointsTo, int pos)
pointsTo
- the pointer will point onto this node. However, pointer
points between the nodes, thus it will point right before this node. It
must not be null
nor an attribute node.pos
- if the pointsTo
node denotes a text or cdata
node then pos can specify the position of the character where the pointer
shall point. Otherwise it must be zero.
public DomPointer createFirstIn(Node parent, EnumSet<DomPointerFlag> flags)
parentElement
equal to
given parent. If no such pointer is applicable then null
is returned. Only the DONT_GO_INTO_ELEMENTS
flag is always
turned on, other flags needs to be specified.
parent
- the parent element or document nodeflags
- flags which must the result pointer comply.
null
if no such pointer exists.public DomPointer getFirst(EnumSet<DomPointerFlag> ptrFlags)
ptrFlags
- flags that the returned pointer must comply.
public DomPointer getLast(EnumSet<DomPointerFlag> ptrFlags)
ptrFlags
- flags that the returned pointer must comply.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |