|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.attribute.XMLVisitor
This class implements a visitor for AttributeSets. It traverses
an AttributeSet and generates a xml representation that is
written to a sepecified PrintStream.
| Constructor Summary | |
XMLVisitor(java.io.PrintStream pout)
Constructor specifying a PrintStream to write the xml-
output to. |
|
| Method Summary | |
boolean |
acceptFilter(Attribute attribute,
int level,
java.lang.String path)
This method allows fine grained control of what subtrees in the hierarchy are visited by means of the return value of this method. |
void |
beginVisit()
This method is invoked before the traversal of an AttributeCollection hierarchy
actually begins. |
void |
endVisit()
This method is invoked after an AtributeCollection
traversal has ended. |
void |
enterAttribute(Attribute attribute,
int level,
java.lang.String path)
This method is invoked during traversal of an AtributeCollection
hierarchy each time an attribute is encountered and entered. |
void |
enterAttributeCollection(AttributeCollection set,
int level,
java.lang.String path)
This method is invoked during traversal of an AtributeCollection
hierarchy each time a nested AtributeCollection is encountered
and entered. |
void |
leaveAttribute(Attribute attribute,
int level,
java.lang.String path)
This method is invoked during traversal of an AtributeCollection
hierarchy each time after an attribute was visited. |
void |
leaveAttributeCollection(AttributeCollection set,
int level,
java.lang.String path)
This method is invoked during traversal of an AtributeCollection
hierarchy each time after an AtributeCollection was visited.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XMLVisitor(java.io.PrintStream pout)
PrintStream to write the xml-
output to.
pout - the stream to write the xml-output to.| Method Detail |
public void beginVisit()
AttributeCollectionVisitorAttributeCollection hierarchy
actually begins. Initialization can be done here.
beginVisit in interface AttributeCollectionVisitorpublic void endVisit()
AttributeCollectionVisitorAtributeCollection
traversal has ended. Cleanup work can be done here.
endVisit in interface AttributeCollectionVisitor
public void enterAttribute(Attribute attribute,
int level,
java.lang.String path)
AttributeCollectionVisitorAtributeCollection
hierarchy each time an attribute is encountered and entered. This method is
invoked before nested AtributeCollection instances are visited.
enterAttribute in interface AttributeCollectionVisitorattribute - the current Attribute of the traversal.level - the nesting level of the traversal.path - the current path of the traversal so far, excluding the
current attribute. The full path to the current attribute thus is
path + AttributeCollection.SEPARATOR + attribute.getName();
public void leaveAttribute(Attribute attribute,
int level,
java.lang.String path)
AttributeCollectionVisitorAtributeCollection
hierarchy each time after an attribute was visited. This method is
invoked after a nested AtributeCollection has been visited.
leaveAttribute in interface AttributeCollectionVisitorattribute - the current Attribute of the traversallevel - the nesting level of the traversalpath - the current path of the traversal so far, excluding the
current attribute. The full path to the current attribute thus is
path + AttributeCollection.SEPARATOR + attribute.getName();
public void enterAttributeCollection(AttributeCollection set,
int level,
java.lang.String path)
AttributeCollectionVisitorAtributeCollection
hierarchy each time a nested AtributeCollection is encountered
and entered. This method is invoked before nested attributes are visited.
enterAttributeCollection in interface AttributeCollectionVisitorset - the current AtributeCollection of the
traversal.level - the nesting level of the traversal.path - the current path of the traversal so far.
public void leaveAttributeCollection(AttributeCollection set,
int level,
java.lang.String path)
AttributeCollectionVisitorAtributeCollection
hierarchy each time after an AtributeCollection was visited.
This method is invoked after nested attributes were visited.
leaveAttributeCollection in interface AttributeCollectionVisitorset - the current AtributeCollection of the
traversal.level - the nesting level of the traversal.path - the current path of the traversal so far.
public boolean acceptFilter(Attribute attribute,
int level,
java.lang.String path)
AttributeCollectionVisitorfalse for a particular Attribute then
the Attribute and all potentially nested
AtributeCollection objects are excluded from the traversal. If no filter
should be used, then this method is implemented with just one statement
returning true. Then the visiting process behaves like no
filter is set at all. This method is a convenience method to limit and
cutoff the search depending on a certain attribute's name or value, the
nesting of the search so far or on the contents of the current
access-path.
acceptFilter in interface AttributeCollectionVisitorattribute - the current Attribute of the traversallevel - the nesting level of the traversal.path - the current path of the traversal so far, excluding the
current Attribute.
false if to exclude this attribute and
nested AtributeCollection objects from the traversal. true
if the traversal shall continue as is. The full path to the current
Attribute thus is
path + AttributeCollection.SEPARATOR + attribute.getName();
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||