|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.document.schema.ElementRule
public class ElementRule
Represents rule for one element, already present in the document. Document
must NOT be modified (not even through DocumentModifier
)
while this instance is used.
Method Summary | |
---|---|
List<? extends Element> |
areElementsDeletable(Set<? extends Element> elements)
Checks whether given elements are deletable. |
AttributeRule |
getAttributeRule(Attr attribute)
Gets attribute rule for given attribute. |
INameList<NewElementRule> |
getEnclosingElements(sk.baka.ikslibs.ptr.DOMPoint start,
sk.baka.ikslibs.ptr.DOMPoint end)
Computes and returns an one-sized insertlist of elements, that can enclose given nodeset. |
INameList<AttributeRule> |
getInsertableAttributes()
Computes all insertable attributes, that can be inserted into given element. |
List<InsertList> |
getInsertableElements(sk.baka.ikslibs.ptr.DOMPoint point)
Computes insertable elements, with their positions between other nodes. |
IValueRule |
getValueRule()
Gets text acceptor, that checks valid text values for given element. |
String |
isAcceptable(sk.baka.ikslibs.ptr.DomPointer ptr,
boolean create,
String newValue)
Checks whether the new text value is acceptable. |
boolean |
isAnyStringInsertable(sk.baka.ikslibs.ptr.DOMPoint ip)
Checks, if there can be any string inserted into given point. |
boolean |
isDeclosable(Element e)
Checks if given element is declosable - if the contents of given element can replace the element. |
boolean |
isDeletable(sk.baka.ikslibs.ptr.DOMPoint start,
sk.baka.ikslibs.ptr.DOMPoint end)
Checks if given node interval is removable. |
boolean |
isDeletable(EntityReference entity)
Checks if given entity node is removable. |
boolean |
isDeletableAttribute(Attr attribute)
Checks, whether given attribute is deletable from its element. |
boolean |
isInsertable(sk.baka.ikslibs.ptr.DOMPoint ip,
DocumentFragment frag)
Checks if all nodes from the document fragment are insertable t the specified position. |
boolean |
isInsertable(sk.baka.ikslibs.ptr.DOMPoint ip,
String entityName)
Checks if the entity is insertable at the specified position. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public List<InsertList> getInsertableElements(sk.baka.ikslibs.ptr.DOMPoint point)
createElement()
for each element.
point
- insertion point, before which we want to insert element. If
InsertPoint.FIRST
, new element will be created before
first node.
public INameList<AttributeRule> getInsertableAttributes()
Computes all insertable attributes, that can be inserted into given
element. Returned NameList
must NOT be used to create more
than one attribute.
Warning: when creating attributes with same namespace as their owner element (local namespaces), their prefix AND namespace MUST be null.
RulePool.AttributeRule
objects.public boolean isDeletableAttribute(Attr attribute)
attribute
- attribute to check.
public AttributeRule getAttributeRule(Attr attribute)
attribute
- return rule for this attribute.
public boolean isAnyStringInsertable(sk.baka.ikslibs.ptr.DOMPoint ip)
Checks, if there can be any string inserted into given point. Must be used only for element, that contains some elements - if true, then any string can be inserted at selected position, if false, then no string can be inserted at all.
When element doesn't contain no child element, then
getValueRule
should be used: it returns more useful rule.
ip
- insert point, where we want to insert some text. ip.pos must be
equal to zero.
public IValueRule getValueRule()
null
.public String isAcceptable(sk.baka.ikslibs.ptr.DomPointer ptr, boolean create, String newValue)
null
is returned, otherwise an error
string is given.
ptr
- points to text/cdata node whose text value has to be modified,
or to a place where text/cdata node is about to be created.create
- if true then new text/cdata node is about to be created at
specified pointer. If false then the node where ptr points will be
modified.newValue
- the new text value.
null
if new element content will be accepted, or
non- null
error string if new value is rejected.public String toString()
toString
in class Object
public List<? extends Element> areElementsDeletable(Set<? extends Element> elements)
null
is returned then given elements
are not deletable.
elements
- set of elements that are to be deleted.
elements
aswell. If null
is returned then
given elements cannot be deleted.public INameList<NewElementRule> getEnclosingElements(sk.baka.ikslibs.ptr.DOMPoint start, sk.baka.ikslibs.ptr.DOMPoint end)
start
- the start of the nodeset. It must point before the
end
insertpoint.end
- the end of the nodeset.
null
is returned then no such element is suitable.public boolean isDeclosable(Element e)
e
- the element to declose
true
if e is declosable, false
otherwise.public boolean isInsertable(sk.baka.ikslibs.ptr.DOMPoint ip, String entityName)
ip
- the insertpoint where the entity should be inserted.entityName
- the name of the entity
true
if the entity is insertable,
false
otherwise.public boolean isInsertable(sk.baka.ikslibs.ptr.DOMPoint ip, DocumentFragment frag)
ip
- the insertpoint where the nodes should be inserted.frag
- the document fragment containing the nodes
true
if the entity is insertable,
false
otherwise.public boolean isDeletable(EntityReference entity)
entity
- the entity node, it must be a descendant of this element.
public boolean isDeletable(sk.baka.ikslibs.ptr.DOMPoint start, sk.baka.ikslibs.ptr.DOMPoint end)
start
- the start of the intervalend
- the end of the interval
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |