- Type Parameters:
D- declaring typeT- generic type
- All Implemented Interfaces:
IuAnnotatedElement,IuDeclaredElement<D>,IuNamedElement<D>,IuParameterizedElement,IuType<D,,T> ParameterizedFacade
IuType.
Always includes a non-null reference() for which
IuTypeReference.referent() == this.
Delegates most lookups to a TypeTemplate, but propagates independent
resolution of type parameters based on arguments provided via referrer, which
may or may not be the same TypeTemplate this facade delegates to.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ParameterizedElementParameterized element mix-in.(package private) final TypeTemplate<D, T> Holds a reference to the template this facade delegates to. -
Constructor Summary
ConstructorsConstructorDescriptionTypeFacade(TypeTemplate<D, T> template, ElementBase referrer, IuReferenceKind referenceKind) Constructor for a non-named, non-indexed reference.TypeFacade(TypeTemplate<D, T> template, ElementBase referrer, IuReferenceKind referenceKind, int referenceIndex) Constructor for an indexed reference.TypeFacade(TypeTemplate<D, T> template, ElementBase referrer, IuReferenceKind referenceKind, String referenceName) Constructor for a named reference. -
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
Aannotation(Class<A> annotationType) Gets an annotation.Iterable<? extends Annotation> Gets all defined annotations.Returns the autobox equivalentReturns the default value for an object or primitive type.Iterable<? extends IuConstructor<T>> Gets all constructors defined by this type.Gets the declaring type.deref()Gets the generic type.voidDestroys an instance.Gets enclosed types.erase()Get the type erasure class.fields()Gets all fields defined by this type, followed by all fields defined by all types in this type's hierarchy, inIuType.hierarchy()order.booleanhasAnnotation(Class<? extends Annotation> annotationType) Determines if an annotation is present.Iterable<TypeFacade<?, ? super T>> Iterates the type hierarchy, from most specific to least specific.methods()Gets all methods defined by this type.name()Gets the name.voidObserves a new instance.booleanDetermines if access to this element is permitted for all users in the current context.booleanDetermines if access to this element is permitted in the current context.Iterable<? extends IuProperty<? super T, ?>> Gets all properties defined by this type, followed by all properties defined by all types in this type's hierarchy, inIuType.hierarchy()order.IuTypeReference<T, ?> Gets the reference used to obtain this type.Refers to a type in the the described type's hierarchy.Gets a type-enforced facade for a specific sub-type of the described type.subscribe(InstanceReference<T> instanceReference) Subscribes a new instance reference.toString()Map<String, TypeFacade<?, ?>> Gets type parameters by name.Methods inherited from class iu.type.ElementBase
checkSealed, postInit, sealMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface edu.iu.type.IuType
annotatedConstructors, annotatedFields, annotatedMethods, annotatedProperties, constructor, constructor, field, method, method, propertyMethods inherited from interface iu.type.ParameterizedFacade
typeParameter
-
Field Details
-
template
Holds a reference to the template this facade delegates to. -
parameterizedElement
Parameterized element mix-in.May be used by related components to apply type arguments to managed instances before sealing. Once sealed, the public interface (i.e.,
IuParameterizedElement.typeParameter(String)) is preferred.
-
-
Constructor Details
-
TypeFacade
TypeFacade(TypeTemplate<D, T> template, ElementBase referrer, IuReferenceKind referenceKind) Constructor for a non-named, non-indexed reference.- Parameters:
template- type templatereferrer- referrer elementreferenceKind- reference kind
-
TypeFacade
TypeFacade(TypeTemplate<D, T> template, ElementBase referrer, IuReferenceKind referenceKind, String referenceName) Constructor for a named reference.- Parameters:
template- type templatereferrer- referrer elementreferenceKind- reference kindreferenceName- reference name
-
TypeFacade
TypeFacade(TypeTemplate<D, T> template, ElementBase referrer, IuReferenceKind referenceKind, int referenceIndex) Constructor for an indexed reference.- Parameters:
template- type templatereferrer- referrer elementreferenceKind- reference kindreferenceIndex- reference index
-
-
Method Details
-
reference
Description copied from interface:IuTypeGets the reference used to obtain this type. -
typeParameters
Description copied from interface:IuParameterizedElementGets type parameters by name.- Specified by:
typeParametersin interfaceIuParameterizedElement- Specified by:
typeParametersin interfaceParameterizedFacade- Returns:
- map of type parameter facades
-
hasAnnotation
Description copied from interface:IuAnnotatedElementDetermines if an annotation is present.- Specified by:
hasAnnotationin interfaceIuAnnotatedElement- Parameters:
annotationType- annotation type- Returns:
- true if the annotation is present, else null
-
annotation
Description copied from interface:IuAnnotatedElementGets an annotation.- Specified by:
annotationin interfaceIuAnnotatedElement- Type Parameters:
A- annotation type- Parameters:
annotationType- annotation type- Returns:
- annotation if present, else null
-
annotations
Description copied from interface:IuAnnotatedElementGets all defined annotations.- Specified by:
annotationsin interfaceIuAnnotatedElement- Returns:
- all annotations
-
permitted
Description copied from interface:IuAnnotatedElementDetermines if access to this element is permitted in the current context.- Specified by:
permittedin interfaceIuAnnotatedElement- Parameters:
isUserInRole- Delegates role-checks to a higher level module.- Returns:
- true if access is permitted in the current context; else false
-
permitted
public boolean permitted()Description copied from interface:IuAnnotatedElementDetermines if access to this element is permitted for all users in the current context.- Specified by:
permittedin interfaceIuAnnotatedElement- Returns:
- true if access is permitted for all users in the current context; else false
-
sub
Description copied from interface:IuTypeGets a type-enforced facade for a specific sub-type of the described type.- Specified by:
subin interfaceIuType<D,T> - Type Parameters:
S- sub-type- Parameters:
subclass- subclass of the described type- Returns:
- this
- Throws:
ClassCastException- If the type does not erase to a subclass
-
autoboxClass
Description copied from interface:IuTypeReturns the autobox equivalent- Specified by:
autoboxClassin interfaceIuType<D,T> - Returns:
- the object version related to a primitive type, or the class passed in as-is if not primitive
-
autoboxDefault
Description copied from interface:IuTypeReturns the default value for an object or primitive type.- Specified by:
autoboxDefaultin interfaceIuType<D,T> - Returns:
- The default value that would be assigned to a field of described primitive type if declared without an initializer; null if the described time is not primitive.
-
name
Description copied from interface:IuNamedElementGets the name.- Specified by:
namein interfaceIuNamedElement<D>- Returns:
- name
-
declaringType
Description copied from interface:IuDeclaredElementGets the declaring type.- Specified by:
declaringTypein interfaceIuDeclaredElement<D>- Returns:
- declaring type
-
deref
Description copied from interface:IuTypeGets the generic type. -
erase
Description copied from interface:IuTypeGets theerasedfacade, which describing theClassrepresenting the erasure of the generic type.The
IuType.deref()of the erased facade must return aClass. -
erasedClass
Description copied from interface:IuTypeGet the type erasure class.Shorthand for
IuType.erase().IuType.deref()- Specified by:
erasedClassin interfaceIuType<D,T> - Returns:
- type erasure class
- See Also:
-
hierarchy
Description copied from interface:IuTypeIterates the type hierarchy, from most specific to least specific.- All
Class.getGenericInterfaces() Class.getGenericSuperclass()- Iterate
IuType.hierarchy()untilObjectis reached
This type described by this facade is not included.
Objectis always the last element. - All
-
referTo
Description copied from interface:IuTypeRefers to a type in the the described type's hierarchy.When the referent type declares type parameters, the resolved generic types associated with those parameters are described by the returned facade.
-
enclosedTypes
Description copied from interface:IuTypeGets enclosed types.- Specified by:
enclosedTypesin interfaceIuType<D,T> - Returns:
- enclosed types
-
constructors
Description copied from interface:IuTypeGets all constructors defined by this type.- Specified by:
constructorsin interfaceIuType<D,T> - Returns:
- constructors
-
fields
Description copied from interface:IuTypeGets all fields defined by this type, followed by all fields defined by all types in this type's hierarchy, inIuType.hierarchy()order.- Specified by:
fieldsin interfaceIuType<D,T> - Returns:
- fields declared by this type and its hierarchy, in this followed by
IuType.hierarchy()order
-
properties
Description copied from interface:IuTypeGets all properties defined by this type, followed by all properties defined by all types in this type's hierarchy, inIuType.hierarchy()order.- Specified by:
propertiesin interfaceIuType<D,T> - Returns:
- properties declared by this type and its hierarchy, in this followed
by
IuType.hierarchy()order
-
methods
Description copied from interface:IuTypeGets all methods defined by this type.The result
iteratesall methods declared on all classes in the type erasure's hierarchy with private erasure for duplicately defined methods. -
observe
Description copied from interface:IuTypeObserves a new instance.Observing an instance registers it with the implementation module as an available target for type introspection, for example, for resource binding. Implementors of
InstanceReferencemay useIuType.subscribe(InstanceReference)to be notified when new instances are observed.Once all
InstanceReferences have been notified, all methods annotated by @PostConstruct will be invoked on the instance.Observing an instance that is already observed has no effect, nor does observing an instance of a type that has no subscribers. All instances provided via
IuExecutable.exec(Object...)are observed automatically. This method is a no-op for those instances, however it is up to implementors to ensure @PostConstruct methods do not result in errors or repeat initialization steps when invoked repeatedly. -
destroy
Description copied from interface:IuTypeDestroys an instance.Invokes all @PreDestroy methods on an instance. If the instance was
observed, its state will be reverted and no futures actions will be taken on it.This method may be invoked to close the lifecycle of instances created via
IuExecutable.exec(Object...).Destroying an instance that is already destroyed should have no effect, but it is up to implementors to ensure @PreDestroy methods do not result in errors or other side-effects when invoked repeatedly.
-
subscribe
Description copied from interface:IuTypeSubscribes a new instance reference. -
toString
-