public class TypeGraph
extends java.lang.Object
Title: Framework Support Library
Description: This class represent a Java type graph, which is a tree with the Java type as a root, the type fields as the root children, fields of these fields as children of the root children and so on.
TypeAnalyzer
for details.
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
Constructor and Description |
---|
TypeGraph(java.lang.String fieldName,
java.lang.reflect.Type fieldType)
Creates a type graph node with the specified name and type
|
TypeGraph(java.lang.String fieldName,
java.lang.reflect.Type fieldType,
int fieldModifiers,
TypeGraph parentNode)
Creates a type graph node with the specified name, type, modifiers and parent node
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(TypeGraph child)
Adds the specified child sub-tree to the current graph node
|
java.lang.String |
getAlias()
Returns property alias
|
TypeGraph |
getChild(java.lang.String childName)
Returns the child of the current node in the graph, which has the specified name
|
java.util.ArrayList |
getChildren()
Returns the list of children of the current node in the graph
|
int |
getModifiers()
Returns the modifiers of the current node in the graph
|
java.lang.String |
getName()
Returns the name of the current node in the graph
|
TypeGraph |
getNode(java.lang.String path)
Returns the node in the graph by its SDR path.
|
TypeGraph |
getParent()
Returns the parent of the current node in the graph
|
java.lang.String |
getPath()
Returns the SDR path of the node in the graph.
|
java.lang.reflect.Type |
getType()
Returns the type of the current node in the graph
|
void |
merge(java.lang.String path,
TypeGraph graphToMerge)
Merges the specified graph to the current graph node located by the specified SDR path.
|
void |
setAlias(java.lang.String alias)
Sets the specified alias for a node
|
void |
setModifiers(int fieldModifiers)
Sets the modifiers of the current node in the graph
|
void |
setName(java.lang.String fieldName)
Sets the name of the current node in the graph
|
void |
setParent(TypeGraph parentNode)
Sets the parent of the current node in the graph
|
void |
setType(java.lang.reflect.Type fieldType)
Sets the type of the current node in the graph
|
void |
traverse(TypeGraphVisitor visitor)
Traverses the type graph and applies the specified visitor to each traversed node
|
public TypeGraph(java.lang.String fieldName, java.lang.reflect.Type fieldType)
fieldName
- The name of the created nodefieldType
- The type of the created nodepublic TypeGraph(java.lang.String fieldName, java.lang.reflect.Type fieldType, int fieldModifiers, TypeGraph parentNode)
fieldName
- The name of the created nodefieldType
- The type of the created nodefieldModifiers
- The modifiers of the created nodeparentNode
- The parent of the created nodepublic java.lang.String getName()
public java.lang.reflect.Type getType()
public int getModifiers()
public TypeGraph getParent()
public java.util.ArrayList getChildren()
public TypeGraph getChild(java.lang.String childName)
childName
- The name of the child node, which should be returnedpublic TypeGraph getNode(java.lang.String path)
TypeAnalyzer
for a description of
SDR paths.path
- The SDR path of the graph node, which should be returnedpublic java.lang.String getPath()
TypeAnalyzer
for a description of
SDR paths.public void setName(java.lang.String fieldName)
fieldName
- The name to be set for the current graph nodepublic void setType(java.lang.reflect.Type fieldType)
fieldType
- The type to be set for the current graph nodepublic void setParent(TypeGraph parentNode)
parentNode
- The parent to be set for the current graph nodepublic void setModifiers(int fieldModifiers)
fieldModifiers
- The modifiers to be set for the current graph nodepublic void addChild(TypeGraph child)
child
- The sub-tree to be added to the current graph nodepublic java.lang.String getAlias()
public void setAlias(java.lang.String alias)
alias
- public void traverse(TypeGraphVisitor visitor) throws TypeAnalyzerException
visitor
- The visitor to be applied to each traversed node of the graphTypeAnalyzerException
- If an error occurred during visiting of some node by the
specified visitor.public void merge(java.lang.String path, TypeGraph graphToMerge)
TypeAnalyzer
for a description of SDR paths.path
- The SDR path of the node to which the specified graph should be mergedgraphToMerge
- The graph to be mergedCopyright © 2015-2024 StreamScape Technologies. All rights reserved.