org.alltimeflashdreamer.dimdom
Class AbstractXHTMLDocument.RepeatedElement
java.lang.Object
|
+--org.alltimeflashdreamer.dimdom.AbstractXHTMLDocument.RepeatedElement
- Enclosing class:
- AbstractXHTMLDocument
- protected class AbstractXHTMLDocument.RepeatedElement
- extends Object
This simple class stored the template information on a repeated element,
i.e. a node that has a defined dimdom attribute, defining the maximum
number of repetitions that may be made on the same node.
Constructor Summary |
protected |
AbstractXHTMLDocument.RepeatedElement(Node repeatedNode,
String sRepeatCommand)
Stores the underlying, repeated node pointer and calls the
CommandParser to find out how many repetitions may be maximally made
on this node. |
Method Summary |
int |
getMaxRepetitionCount()
Returns the number of repetitions that may be made on this node or
-1, if unlimited. |
protected int |
getProcessedRepetitionsCount()
Returns the (current) amount of repetition cycles that have been
processed on this class' repeated node until now. |
Node |
getRepeatedNode()
Returns the underlying, to-be-repeated node of the document that this
class was created for (may be either the original or the cloned
Document object!). |
protected boolean |
isRepeatable()
Returns whether this class' repeated node is (still) allowed to be
repeated. |
protected void |
processRepetition()
Notifies this class that it's repeated node has been repeated / is
now in process of repetition. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractXHTMLDocument.RepeatedElement
protected AbstractXHTMLDocument.RepeatedElement(Node repeatedNode,
String sRepeatCommand)
throws DimDomException
- Stores the underlying, repeated node pointer and calls the
CommandParser to find out how many repetitions may be maximally made
on this node. In case the node is a DimDom-relevant node, it's
cleaned up first, e.g. the existing option tags from the template are
removed.
- Parameters:
repeatedNode
- the node that contains a micro-template
structuresRepeatCommand
- the value of the dimdom attribute in the
template- Throws:
DimDomException
- thrown by the command parser
getMaxRepetitionCount
public int getMaxRepetitionCount()
- Returns the number of repetitions that may be made on this node or
-1, if unlimited.
- Returns:
- the value of the dimdom attribute's repeat command in the
template
getRepeatedNode
public Node getRepeatedNode()
- Returns the underlying, to-be-repeated node of the document that this
class was created for (may be either the original or the cloned
Document object!).
- Returns:
- the underlying, to-be-repeated node
getProcessedRepetitionsCount
protected int getProcessedRepetitionsCount()
- Returns the (current) amount of repetition cycles that have been
processed on this class' repeated node until now. 0 means that the
class haven't been repeated yet, i.e. the method processRepetiton has
never been called.
- Returns:
- the number of already processed repetition cycles
processRepetition
protected void processRepetition()
- Notifies this class that it's repeated node has been repeated / is
now in process of repetition. This leads to an update of the current
number of repetitions.
isRepeatable
protected boolean isRepeatable()
- Returns whether this class' repeated node is (still) allowed to be
repeated. This depends on the node's dimdom attribute in the
template: If the node is allowed to be repeated unlimitedly, this
method returns true anyway, else true is returned only if the number
of processed repetitions is lower than the maximum allowed number of
repetitions.
- Returns:
- whether the node is (still) allowed to be repeated