org.mesopotamia.lang.java
Class TypeDefinition
java.lang.Object
LanguageElement
org.mesopotamia.lang.java.JavaLanguageElement
org.mesopotamia.lang.java.Field
org.mesopotamia.lang.java.TypeDefinition
- All Implemented Interfaces:
- Info, TypeInfo
- Direct Known Subclasses:
- AnnotationDefinition, ClassOrInterfaceDefinition, EnumDefinition
public class TypeDefinition
- extends Field
- implements TypeInfo
Constructor Summary |
TypeDefinition(NodeData xData,
java.lang.Class<?> context,
Scan scan,
RepositoryLanguage language,
java.lang.Object environment)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeDefinition
public TypeDefinition(NodeData xData,
java.lang.Class<?> context,
Scan scan,
RepositoryLanguage language,
java.lang.Object environment)
throws MesopotamiaException
- Throws:
MesopotamiaException
toDom
public void toDom(org.w3c.dom.Element holder)
- Overrides:
toDom
in class Field
getName
public java.lang.String getName()
- Specified by:
getName
in interface Info
- Returns:
- Variable, type of method name.
getFields
public java.util.List<Field> getFields()
acceptChildren
protected void acceptChildren(Visitor visitor)
- Overrides:
acceptChildren
in class Field
getFcn
public java.lang.String getFcn()
- Description copied from class:
JavaLanguageElement
- Helper method for giving FCN's to anonymous and local classes.
- Specified by:
getFcn
in interface Info
- Overrides:
getFcn
in class JavaLanguageElement
- Returns:
- Fully qualified name. Null for local variables
and local and anonymous classes/interfaces.
findMethod
public MethodInfo findMethod(java.lang.String name,
java.lang.String[] parameterTypes)
match
public static TypeDefinition.ParameterMatch match(java.util.List<TypeSpecInfo> parameters,
java.util.List<TypeSpecInfo> arguments)
- Matches formal parameter types with arguments for compatibility.
- Parameters:
parameters
- arguments
-
- Returns:
- Match result. Full match means that arguments are exactly of parmeter types,
match means that some of them are subtypes of parameter types.
selectMoreSpecific
public static MethodInfo selectMoreSpecific(MethodInfo m0,
MethodInfo m1)
- Parameters:
m0
- m1
-
- Returns:
- m0 or m1 if m1 is more specific than m0. This method doesn't handle ambiguity.
getEnclosingScope
protected Scope getEnclosingScope()
findType
public TypeInfo findType(java.lang.String name)
findVariable
public VariableInfo findVariable(java.lang.String name)
isKindOfInternal
protected boolean isKindOfInternal(java.lang.String superFcn)
findNestedTypeInternal
protected TypeInfo findNestedTypeInternal(java.lang.String name)
findTypeMethodInternal
protected MethodInfo findTypeMethodInternal(java.lang.String name,
java.lang.String[] argumentTypes)
findTypeVariableInternal
protected VariableInfo findTypeVariableInternal(java.lang.String name)
getDeclaringType
public TypeInfo getDeclaringType()
- Specified by:
getDeclaringType
in interface Info
- Returns:
- Information about declaring type.
Null for local variables and local and anonymous classes.
findConstructor
public MethodInfo findConstructor(java.lang.String[] argumentTypes)
- Specified by:
findConstructor
in interface TypeInfo
findNestedType
public TypeInfo findNestedType(java.lang.String name)
- Specified by:
findNestedType
in interface TypeInfo
findTypeMethod
public MethodInfo findTypeMethod(java.lang.String name,
java.lang.String[] argumentTypes)
- Specified by:
findTypeMethod
in interface TypeInfo
findTypeVariable
public VariableInfo findTypeVariable(java.lang.String name)
- Specified by:
findTypeVariable
in interface TypeInfo
isKindOf
public boolean isKindOf(java.lang.String superFcn)
- Specified by:
isKindOf
in interface TypeInfo
- Parameters:
superFcn
- Fully qualified name of superclass or superinterface.
- Returns:
- true if class/interface represented by this type info is the same
or subclass or subinterface of class/interface with name passed in superFcn
parameter.
Copyright © 2005 Hammurapi Group. All Rights Reserved.