Class Model


  • public class Model
    extends java.lang.Object
    The type Model.
    • Field Detail

      • network

        protected Network network
        The Network.
      • node2Descriptor

        protected java.util.Map<java.lang.Object,​java.lang.Object> node2Descriptor
        The Node 2 descriptor.
      • node2Type

        protected java.util.Map<java.lang.Object,​java.lang.Object> node2Type
        The Node 2 type.
      • VOID_DESC

        public static java.lang.String VOID_DESC
        The constant VOID_DESC.
      • CONSTRUCTOR_NAME

        public static final java.lang.String CONSTRUCTOR_NAME
        The constant CONSTRUCTOR_NAME.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Model

        public Model()
        Instantiates a new Model.
      • Model

        public Model​(Network network)
        Instantiates a new Model.
        Parameters:
        network - the network
    • Method Detail

      • setClassResolver

        public void setClassResolver​(ClassResolver res)
        Sets class resolver.
        Parameters:
        res - the res
      • setSimpleModelSet

        public void setSimpleModelSet()
        Sets simple model set.
      • isSimpleModelSet

        public boolean isSimpleModelSet()
        Is simple model set boolean.
        Returns:
        the boolean
      • getEntryPointNode

        public java.lang.Object getEntryPointNode()
        Gets entry point node.
        Returns:
        the entry point node
      • isClassModeled

        public boolean isClassModeled​(java.lang.String className)
        Is class modeled boolean.
        Parameters:
        className - the class name
        Returns:
        the boolean
      • createDependencyEdge

        public java.lang.Object createDependencyEdge​(AbstractDescriptor source,
                                                     AbstractDescriptor target,
                                                     EdgeType type)
        creates a dependency of type type iff no edge of the same type exists between source and target.
        Parameters:
        source - the edge source
        target - the edge target
        type - the edge type
        Returns:
        the created edge, or null if no edge was created
      • createDependencyEdge

        public java.lang.Object createDependencyEdge​(java.lang.Object sourceNode,
                                                     java.lang.Object targetNode,
                                                     EdgeType edgeType)
        Create dependency edge edge.
        Parameters:
        sourceNode - the source node
        targetNode - the target node
        edgeType - the edge type
        Returns:
        the edge
      • newClassDescriptor

        public ClassDescriptor newClassDescriptor​(java.lang.String name,
                                                  java.lang.String superName,
                                                  java.lang.String[] interfaces,
                                                  int access,
                                                  java.io.File sourceJar)
        New class descriptor class descriptor.
        Parameters:
        name - the name
        superName - the super name
        interfaces - the interfaces
        access - the access
        sourceJar - the source jar
        Returns:
        the class descriptor
      • newMethodDescriptor

        public MethodDescriptor newMethodDescriptor​(ClassDescriptor cd,
                                                    int access,
                                                    java.lang.String name,
                                                    java.lang.String desc,
                                                    java.lang.String[] exceptions,
                                                    java.io.File sourceJar)
        New method descriptor method descriptor.
        Parameters:
        cd - the cd
        access - the access
        name - the name
        desc - the desc
        exceptions - the exceptions
        sourceJar - the source jar
        Returns:
        the method descriptor
      • newFieldDescriptor

        public FieldDescriptor newFieldDescriptor​(ClassDescriptor cd,
                                                  java.lang.String desc,
                                                  java.lang.String name,
                                                  int access,
                                                  java.io.File sourceJar)
        New field descriptor field descriptor.
        Parameters:
        cd - the cd
        desc - the desc
        name - the name
        access - the access
        sourceJar - the source jar
        Returns:
        the field descriptor
      • getAllClassDescriptors

        public java.util.Collection<ClassDescriptor> getAllClassDescriptors()
        Gets all class descriptors.
        Returns:
        the all class descriptors
      • getAllClassNames

        public java.util.Collection<java.lang.String> getAllClassNames()
        Gets all class names.
        Returns:
        the all class names
      • getClassDescriptor

        public ClassDescriptor getClassDescriptor​(java.lang.String className)
        Gets class descriptor.
        Parameters:
        className - the class name
        Returns:
        the class descriptor
      • getDescriptor

        public AbstractDescriptor getDescriptor​(java.lang.Object n)
        Gets descriptor.
        Parameters:
        n - the n
        Returns:
        the descriptor
      • getClassNode

        public java.lang.Object getClassNode​(java.lang.Object memberNode)
        Gets class node.
        Parameters:
        memberNode - the member node
        Returns:
        the class node
      • getDependencyType

        public EdgeType getDependencyType​(java.lang.Object e)
        Gets dependency type.
        Parameters:
        e - the e
        Returns:
        the dependency type
      • getAllImplementingClasses

        public java.util.Set<ClassDescriptor> getAllImplementingClasses​(ClassDescriptor cd)
        retrieve all implementing classes of cd.
        Parameters:
        cd - the cd
        Returns:
        List of ClassDescriptors containing all classes that implement cd
      • getAllImplementedInterfaces

        public void getAllImplementedInterfaces​(java.lang.String className,
                                                java.util.Set<java.lang.String> interfaces)
        Gets all implemented interfaces.
        Parameters:
        className - the class name
        interfaces - the interfaces
      • getAllAncestorClasses

        public void getAllAncestorClasses​(java.lang.String className,
                                          java.util.Set<java.lang.String> parents)
        Gets all ancestor classes.
        Parameters:
        className - the class name
        parents - the parents
      • getAllInternalAncestorEntrypointMethods

        public void getAllInternalAncestorEntrypointMethods​(java.lang.String className,
                                                            java.util.List<MethodDescriptor> methods)
        Gets all internal ancestor entrypoint methods.
        Parameters:
        className - the class name
        methods - the methods
      • getAllExternalAncestorMethods

        public boolean getAllExternalAncestorMethods​(java.lang.String className,
                                                     java.util.List<java.lang.reflect.Method> methods)
        Gets all external ancestor methods.
        Parameters:
        className - the class name
        methods - the methods
        Returns:
        the all external ancestor methods
      • getInternalDescendants

        public void getInternalDescendants​(ClassDescriptor cd,
                                           java.util.List<ClassDescriptor> descendants)
        collects all subclasses of cd
        Parameters:
        cd - the cd
        descendants - the descendants
      • isMethodExternallyDefined

        public boolean isMethodExternallyDefined​(ClassDescriptor origClass,
                                                 MethodDescriptor md)
        determine wether the method md is implemented in any superclasses of class className or if md is declared in any interface that class className or any superclass of class className implements.
        Parameters:
        origClass - the orig class
        md - the md
        Returns:
        true iff an implementation or declaration of md is found in any ancestor class/interface of class className
      • createEntryPointEdges

        public void createEntryPointEdges​(java.util.List<AbstractDescriptor> entryPoints)
        Create entry point edges.
        Parameters:
        entryPoints - the entry points
      • isAllResolved

        public boolean isAllResolved()
        Is all resolved boolean.
        Returns:
        the boolean
      • getNodeType

        public int getNodeType​(java.lang.Object n)
        Gets node type.
        Parameters:
        n - the n
        Returns:
        the node type
      • markObsolete

        public void markObsolete​(java.lang.Object n)
        Mark obsolete.
        Parameters:
        n - the n
      • markNotObsolete

        public void markNotObsolete​(java.lang.Object n)
        Mark not obsolete.
        Parameters:
        n - the n
      • markStubNeeded

        public void markStubNeeded​(java.lang.Object n)
        Mark stub needed.
        Parameters:
        n - the n
      • isObsolete

        public boolean isObsolete​(java.lang.Object n)
        Is obsolete boolean.
        Parameters:
        n - the n
        Returns:
        the boolean
      • isStubNeeded

        public boolean isStubNeeded​(java.lang.Object n)
        Is stub needed boolean.
        Parameters:
        n - the n
        Returns:
        the boolean
      • getNetwork

        public Network getNetwork()
        Gets network.
        Returns:
        the network