public interface ClassHierarchy
When Tang is running inside the same environment as the injected objects, ClassHierarchy is simply a read-only representation of information that is made available via language reflection.
If Tang is set up to perform remote injection, then the ClassHierarchy it runs against is backed by a flat file, or other summary of the libraries that will be available during injection.
Modifier and Type | Method and Description |
---|---|
Node |
getNamespace()
Return a reference to the root of the ClassHierarchy.
|
Node |
getNode(String fullName)
Lookup a node in this class hierarchy.
|
boolean |
isImplementation(ClassNode<?> inter,
ClassNode<?> impl)
Return whether the impl is a subclass of inter.
|
ClassHierarchy |
merge(ClassHierarchy ch)
Merge the contents of this ClassHierarchy and the provided one into a new
class hierarchy.
|
Node getNode(String fullName) throws NameResolutionException
fullName
- The full name of the class that will be looked up.NameResolutionException
- If the class is not found.ClassHierarchyException
- If the class does not pass Tang's static analysis.boolean isImplementation(ClassNode<?> inter, ClassNode<?> impl)
inter
- a interface classimpl
- a implementation classClassHierarchy merge(ClassHierarchy ch)
ClassHierarchies derived from applications written in different languages cannot be merged.
ch
- a class hierarchy to be mergedNode getNamespace()
Normal callers (all use cases except ClassHierarchy serialization) should use getNode(String) to lookup classes, since getNamespace() can not support lazy loading of unknown classes.
Copyright © 2017 The Apache Software Foundation. All rights reserved.