org.glassfish.hk2.classmodel.reflect.impl
Class ExtensibleTypeImpl<T extends ExtensibleType>

java.lang.Object
  extended by org.glassfish.hk2.classmodel.reflect.impl.AnnotatedElementImpl
      extended by org.glassfish.hk2.classmodel.reflect.impl.TypeImpl
          extended by org.glassfish.hk2.classmodel.reflect.impl.ExtensibleTypeImpl<T>
All Implemented Interfaces:
AnnotatedElement, ExtensibleType<T>, Type
Direct Known Subclasses:
ClassModelImpl, InterfaceModelImpl

public abstract class ExtensibleTypeImpl<T extends ExtensibleType>
extends TypeImpl
implements ExtensibleType<T>

Implementation of an extensible type (Class or Interface)


Constructor Summary
ExtensibleTypeImpl(String name, TypeProxy<Type> sink, TypeProxy parent)
           
 
Method Summary
 Collection<T> allSubTypes()
          Returns all the children subtypes (including grand children) of this type.
 Collection<InterfaceModel> getInterfaces()
          Returns an unmodifiable list of interfaces implemented or extended by this type.
 Collection<ParameterizedInterfaceModel> getParameterizedInterfaces()
           
 T getParent()
          Return the parent type instance.
 Collection<FieldModel> getStaticFields()
          Returns an unmodifiable list of static fields defined by this type
protected  void print(StringBuffer sb)
          prints a meaningful string
 TypeProxy<?> setParent(TypeProxy<?> parent)
           
 Collection<T> subTypes()
          Returns the child subtypes of this type.
 
Methods inherited from class org.glassfish.hk2.classmodel.reflect.impl.TypeImpl
getDefiningURIs, getMethods, getReferences, wasDefinedIn
 
Methods inherited from class org.glassfish.hk2.classmodel.reflect.impl.AnnotatedElementImpl
getAnnotation, getAnnotations, getName, shortDesc, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.glassfish.hk2.classmodel.reflect.Type
getDefiningURIs, getMethods, getReferences, wasDefinedIn
 
Methods inherited from interface org.glassfish.hk2.classmodel.reflect.AnnotatedElement
getAnnotation, getAnnotations, getName, shortDesc
 

Constructor Detail

ExtensibleTypeImpl

public ExtensibleTypeImpl(String name,
                          TypeProxy<Type> sink,
                          TypeProxy parent)
Method Detail

getParent

public T getParent()
Description copied from interface: ExtensibleType
Return the parent type instance. If there are more than one parent with the same FQCN within the various URI we parsed, we return the one defined within the same URI (if it exists). If there is more than one parsed metadata with the same FQCN and none of them are defined within the same URI as this type, then null is returned.

Specified by:
getParent in interface ExtensibleType<T extends ExtensibleType>
Returns:
the parent type instance or null

setParent

public TypeProxy<?> setParent(TypeProxy<?> parent)

getInterfaces

public Collection<InterfaceModel> getInterfaces()
Description copied from interface: ExtensibleType
Returns an unmodifiable list of interfaces implemented or extended by this type.

Specified by:
getInterfaces in interface ExtensibleType<T extends ExtensibleType>
Returns:
collection of implemented or extended interfaces

getParameterizedInterfaces

public Collection<ParameterizedInterfaceModel> getParameterizedInterfaces()
Specified by:
getParameterizedInterfaces in interface ExtensibleType<T extends ExtensibleType>

subTypes

public Collection<T> subTypes()
Description copied from interface: ExtensibleType
Returns the child subtypes of this type. A child subtype is a type which parent is this type.

Specified by:
subTypes in interface ExtensibleType<T extends ExtensibleType>
Returns:
the immediate subtypes

allSubTypes

public Collection<T> allSubTypes()
Description copied from interface: ExtensibleType
Returns all the children subtypes (including grand children) of this type.

Specified by:
allSubTypes in interface ExtensibleType<T extends ExtensibleType>
Returns:
all the children

getStaticFields

public Collection<FieldModel> getStaticFields()
Description copied from interface: ExtensibleType
Returns an unmodifiable list of static fields defined by this type

Specified by:
getStaticFields in interface ExtensibleType<T extends ExtensibleType>

print

protected void print(StringBuffer sb)
prints a meaningful string

Overrides:
print in class TypeImpl
Parameters:
sb - the string buffer to write to.


Copyright © 2013 Oracle Corporation. All Rights Reserved.