|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface INewElementRuleP
Represents rule for one element (the context element), that is being created. This rule may consist of more than one expression, but all expressions must generate exactly one element with required name. These expressions are alternatives to each other; only one expression can be selected to generate new contents of element.
Returned values depends on context element of this instance. This context element doesn't exist yet, it is being created.
Representing class must properly implement equals()
and
hashValue()
to ensure, that it can be properly placed into
HashMap
. These values should be computed only from enclosed
expressions.
When creating element with this rule, choose between the following:
getNewTextRule
, there is no need to creating elements.So, creation algorithm is as follows:
getNewTextRule()
is not null
, then
text is required and must be created.getNewContent
doesn't return null
,
then some elements are required.
Method Summary | |
---|---|
List<IAttributeListRuleP> |
getLists()
For each expression returns one list of attributes, that can be created by this rule. |
IElementSequenceRuleP |
getNewContent(Element e)
Computes all possibilities of content, that can be generated by this rule and inserted into context element. |
IValueRule |
getNewTextRule(Element e)
Computes and returns value rule, that can be inserted into context element. |
Methods inherited from interface sk.uniba.euromath.document.schema.IQNameAcceptor |
---|
accepts, getAccepts, getNamespaceUri |
Methods inherited from interface sk.uniba.euromath.document.schema.plug.IForeignNodeP |
---|
acceptsNamespace, getNamespaces |
Method Detail |
---|
IElementSequenceRuleP getNewContent(Element e)
Computes all possibilities of content, that can be generated by this rule and inserted into context element. There must be only such insertlists, that doesn't contain optional elements. All InsertLists with length equal to 1 should be grouped together in one InsertList.
This content must be computed with existing attributes in mind. Expressions, whose contents violates given attribute set, must not be used.
It must NOT be computed when instance of this object is created.
e
- element with already created attributes. It can be assumed that
element has no content.
null
.List<IAttributeListRuleP> getLists()
For each expression returns one list of attributes, that can be created by this rule. Only required attributes must be included in result set. Special care must be taken: there must not be two equal list rules (with equal rules). If all lists being returned are zero-length then a zero-length sequence must be returned instead.
Should be computed only once, when this function is called for first time.
IValueRule getNewTextRule(Element e)
e
- element with already created attributes. It can be assumed that
element has no content. It may not be inserted in the document.
null
, then no text content is required.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |