|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.util.ObjectWalker
public class ObjectWalker
Walks objects.
Field Summary | |
---|---|
protected ClassSyntax |
syntax
|
Constructor Summary | |
---|---|
ObjectWalker()
Creates a walker that uses the default ClassSyntax. |
|
ObjectWalker(ClassSyntax syntax)
Creates a walker that uses the specified ClassSyntax as a source for ClassDescrs. |
Method Summary | |
---|---|
static java.util.Collection |
collectIf(java.lang.Object source,
java.util.Collection result,
Predicate1 p)
Uses the specified result collection to collect subobjects that satisfy a predicate. |
static java.util.Collection |
collectIf(java.lang.Object source,
Predicate1 p)
Uses a HashSet to collect subobjects that satisfy a predicate. |
static java.lang.Object |
findIf(java.lang.Object source,
Predicate1 p)
Returns the first subobject that satisfies a predicate |
static void |
main(java.lang.String[] argv)
Test loop |
void |
visitElement(java.lang.Object elt)
Called on subobjects of the object being walked. |
void |
visitList(java.util.List obj,
ClassDescr cd)
Walks a List, calling visitElement(Object) on each
element of the list. |
void |
visitMap(java.util.Map obj,
ClassDescr cd)
Walks a Map, calling visitElement(Object) on each
key and value. |
void |
visitPrimitive(java.lang.Object obj,
ClassDescr cd)
Visits a "primitive" object. |
void |
visitSet(java.util.Set obj,
ClassDescr cd)
Walks a Set, calling visitElement(Object) on each
member of the set. |
void |
visitStruct(java.lang.Object obj,
ClassDescr cd)
Walks a structure, calling visitElement(Object) on
each field value. |
void |
visitXML(LiteralDocument xml,
ClassDescr cd)
Walks embedded XML. |
void |
walk(java.lang.Object obj)
Visits the subobjects of an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ClassSyntax syntax
Constructor Detail |
---|
public ObjectWalker()
XML.config()
,
XMLConfig.defaultClassSyntax()
public ObjectWalker(ClassSyntax syntax)
Method Detail |
---|
public static java.lang.Object findIf(java.lang.Object source, Predicate1 p)
public static java.util.Collection collectIf(java.lang.Object source, Predicate1 p)
collectIf(Object, Collection, Predicate1)
.
public static java.util.Collection collectIf(java.lang.Object source, java.util.Collection result, Predicate1 p)
public void walk(java.lang.Object obj)
visitElement(Object)
method.
public void visitElement(java.lang.Object elt)
walk(Object)
on the element and thus
implements a recursive walk.
public void visitPrimitive(java.lang.Object obj, ClassDescr cd)
visitPrimitive
in interface ObjectVisitor
public void visitStruct(java.lang.Object obj, ClassDescr cd)
visitElement(Object)
on
each field value.
visitStruct
in interface ObjectVisitor
public void visitXML(LiteralDocument xml, ClassDescr cd)
visitXML
in interface ObjectVisitor
public void visitList(java.util.List obj, ClassDescr cd)
visitElement(Object)
on each
element of the list.
visitList
in interface ObjectVisitor
public void visitSet(java.util.Set obj, ClassDescr cd)
visitElement(Object)
on each
member of the set.
visitSet
in interface ObjectVisitor
public void visitMap(java.util.Map obj, ClassDescr cd)
visitElement(Object)
on each
key and value.
visitMap
in interface ObjectVisitor
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |