org.apache.tuscany.sca.implementation.java.impl
Class JavaElementImpl

java.lang.Object
  extended by org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl
Direct Known Subclasses:
JavaParameterImpl

public class JavaElementImpl
extends java.lang.Object

This class represents a java element such as a Package, Class, Constructor, Field, Method or Parameter.


Constructor Summary
JavaElementImpl(java.lang.Class<?> cls)
           
JavaElementImpl(java.lang.reflect.Constructor<?> constructor, int index)
           
JavaElementImpl(java.lang.reflect.Field field)
           
JavaElementImpl(java.lang.reflect.Method method, int index)
           
JavaElementImpl(java.lang.Package pkg)
           
JavaElementImpl(java.lang.String name, java.lang.Class<?> type, java.lang.Class<? extends java.lang.annotation.Annotation> classifer)
          For testing purpose
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.reflect.AnnotatedElement getAnchor()
           
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType)
           
 java.lang.annotation.Annotation[] getAnnotations()
           
 java.lang.Class<? extends java.lang.annotation.Annotation> getClassifer()
           
 java.lang.annotation.ElementType getElementType()
           
 java.lang.reflect.Type getGenericType()
           
 int getIndex()
           
 java.lang.String getName()
           
 java.lang.Class<?> getType()
           
 int hashCode()
           
 void setClassifer(java.lang.Class<? extends java.lang.annotation.Annotation> classifer)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaElementImpl

public JavaElementImpl(java.lang.Package pkg)

JavaElementImpl

public JavaElementImpl(java.lang.Class<?> cls)

JavaElementImpl

public JavaElementImpl(java.lang.reflect.Field field)

JavaElementImpl

public JavaElementImpl(java.lang.reflect.Constructor<?> constructor,
                       int index)

JavaElementImpl

public JavaElementImpl(java.lang.reflect.Method method,
                       int index)

JavaElementImpl

public JavaElementImpl(java.lang.String name,
                       java.lang.Class<?> type,
                       java.lang.Class<? extends java.lang.annotation.Annotation> classifer)
For testing purpose

Parameters:
name -
type -
classifer - TODO
elementType -
Method Detail

getAnchor

public java.lang.reflect.AnnotatedElement getAnchor()
Returns:
the anchor

getElementType

public java.lang.annotation.ElementType getElementType()
Returns:
the elementType

getGenericType

public java.lang.reflect.Type getGenericType()
Returns:
the genericType

getIndex

public int getIndex()
Returns:
the index

getType

public java.lang.Class<?> getType()
Returns:
the type

getAnnotations

public java.lang.annotation.Annotation[] getAnnotations()

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getName

public java.lang.String getName()
Returns:
the name

setName

public void setName(java.lang.String name)
Parameters:
name - the name to set

getClassifer

public java.lang.Class<? extends java.lang.annotation.Annotation> getClassifer()
Returns:
the classifier

setClassifer

public void setClassifer(java.lang.Class<? extends java.lang.annotation.Annotation> classifer)
Parameters:
classifer - the classifier to set