|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.schema.UsageFinder
public class UsageFinder
Visitor to generate usage counts for schema components. This is somewhat messy, since there are so many different types of references in schema: 'ref' (attribute, attributeGroup, element, and group, to reference a global definition of same type), 'type' (attribute and element, reference a global type definition), 'base' (extension and restriction), 'itemType' (list), 'memberTypes' (union), 'substitutionGroup' (element), and 'refer' (unique). References can be recursively expanded by matching the reference set against the set of components processed, and processing any new references until the closure is obtained.
Nested Class Summary | |
---|---|
private static class |
UsageFinder.UsageVisitor
Visitor to accumulate usage of definitions. |
Field Summary | |
---|---|
private UsageFinder.UsageVisitor |
m_visitor
Visitor used for finding references. |
private static org.apache.log4j.Logger |
s_logger
Logger for class. |
Constructor Summary | |
---|---|
UsageFinder()
Constructor. |
Method Summary | |
---|---|
void |
addReferenceClosure(AnnotatedBase comp)
Add usage counts for the reference closure of a definition. |
void |
addReferenceClosure(java.util.List list)
Add usage counts for the reference closure of a supplied list of components. |
void |
countSchemaTree(SchemaElement schema)
Add usage counts for a schema tree. |
java.util.Set |
getNonSingletonSet()
Get the set of definitions referenced as optional or repeating. |
ReferenceCountMap |
getUsageMap()
Get map of reference counts per component. |
void |
reset()
Clear the accumulated usage counts. |
void |
setNameRegister(NameRegister reg)
Set the register to be used for resolving name references. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger s_logger
private final UsageFinder.UsageVisitor m_visitor
Constructor Detail |
---|
public UsageFinder()
Method Detail |
---|
public ReferenceCountMap getUsageMap()
public java.util.Set getNonSingletonSet()
public void countSchemaTree(SchemaElement schema)
schema
- public void addReferenceClosure(AnnotatedBase comp)
comp
- definition to be processedpublic void addReferenceClosure(java.util.List list)
list
- starting schema componentspublic void setNameRegister(NameRegister reg)
countSchemaTree(SchemaElement)
, which always sets the register associated with the
supplied schema.
reg
- public void reset()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |