Class ExtensibleTypeImpl<T extends ExtensibleType>
- java.lang.Object
-
- org.glassfish.hk2.classmodel.reflect.impl.AnnotatedElementImpl
-
- org.glassfish.hk2.classmodel.reflect.impl.TypeImpl
-
- 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)
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<TypeProxy<InterfaceModel>>implementedIntfprivate java.util.List<ParameterizedInterfaceModel>implementedParameterizedIntfprivate TypeProxy<?>parentprivate java.util.List<FieldModel>staticFields
-
Constructor Summary
Constructors Constructor Description ExtensibleTypeImpl(java.lang.String name, TypeProxy<Type> sink, TypeProxy parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddField(FieldModel field)(package private) voidaddStaticField(FieldModel field)java.util.Collection<T>allSubTypes()Returns all the children subtypes (including grand children) of this type.java.util.Collection<InterfaceModel>getInterfaces()Returns an unmodifiable list of interfaces implemented or extended by this type.java.util.Collection<ParameterizedInterfaceModel>getParameterizedInterfaces()TgetParent()Return the parent type instance.java.util.Collection<FieldModel>getStaticFields()Returns an unmodifiable list of static fields defined by this type(package private) voidisImplementing(ParameterizedInterfaceModelImpl pim)(package private) voidisImplementing(TypeProxy<InterfaceModel> intf)protected voidprint(java.lang.StringBuffer sb)prints a meaningful stringTypeProxy<?>setParent(TypeProxy<?> parent)java.util.Collection<T>subTypes()Returns the child subtypes of this type.-
Methods inherited from class org.glassfish.hk2.classmodel.reflect.impl.TypeImpl
addDefiningURI, addMethod, getDefiningURIs, getMethods, getProxy, getReferences, wasDefinedIn
-
Methods inherited from class org.glassfish.hk2.classmodel.reflect.impl.AnnotatedElementImpl
addAnnotation, getAnnotation, getAnnotations, getName, isApplicationClass, setApplicationClass, 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.AnnotatedElement
getAnnotation, getAnnotations, getName, shortDesc
-
Methods inherited from interface org.glassfish.hk2.classmodel.reflect.Type
getDefiningURIs, getMethods, getReferences, wasDefinedIn
-
-
-
-
Field Detail
-
parent
private TypeProxy<?> parent
-
staticFields
private final java.util.List<FieldModel> staticFields
-
implementedIntf
private final java.util.List<TypeProxy<InterfaceModel>> implementedIntf
-
implementedParameterizedIntf
private final java.util.List<ParameterizedInterfaceModel> implementedParameterizedIntf
-
-
Method Detail
-
getParent
public T getParent()
Description copied from interface:ExtensibleTypeReturn 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:
getParentin interfaceExtensibleType<T extends ExtensibleType>- Returns:
- the parent type instance or null
-
isImplementing
void isImplementing(TypeProxy<InterfaceModel> intf)
-
isImplementing
void isImplementing(ParameterizedInterfaceModelImpl pim)
-
getInterfaces
public java.util.Collection<InterfaceModel> getInterfaces()
Description copied from interface:ExtensibleTypeReturns an unmodifiable list of interfaces implemented or extended by this type.- Specified by:
getInterfacesin interfaceExtensibleType<T extends ExtensibleType>- Returns:
- collection of implemented or extended interfaces
-
getParameterizedInterfaces
public java.util.Collection<ParameterizedInterfaceModel> getParameterizedInterfaces()
- Specified by:
getParameterizedInterfacesin interfaceExtensibleType<T extends ExtensibleType>
-
subTypes
public java.util.Collection<T> subTypes()
Description copied from interface:ExtensibleTypeReturns the child subtypes of this type. A child subtype is a type which parent is this type.- Specified by:
subTypesin interfaceExtensibleType<T extends ExtensibleType>- Returns:
- the immediate subtypes
-
allSubTypes
public java.util.Collection<T> allSubTypes()
Description copied from interface:ExtensibleTypeReturns all the children subtypes (including grand children) of this type.- Specified by:
allSubTypesin interfaceExtensibleType<T extends ExtensibleType>- Returns:
- all the children
-
addStaticField
void addStaticField(FieldModel field)
-
addField
void addField(FieldModel field)
-
getStaticFields
public java.util.Collection<FieldModel> getStaticFields()
Description copied from interface:ExtensibleTypeReturns an unmodifiable list of static fields defined by this type- Specified by:
getStaticFieldsin interfaceExtensibleType<T extends ExtensibleType>
-
-