java.lang.Object
iu.type.ComponentResourceReference<R,T>
- Type Parameters:
R- referrer typeT- resource type
- All Implemented Interfaces:
InstanceReference<R>,IuResourceReference<R,,T> Consumer<R>
class ComponentResourceReference<R,T>
extends Object
implements IuResourceReference<R,T>, InstanceReference<R>
Implementation of
IuResource;-
Constructor Summary
ConstructorsConstructorDescriptionComponentResourceReference(DeclaredAttribute<R, ? super T> attribute, Resource resource) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts a referrer instance as abinding target.voidbind(IuResource<T> resource) Binds aresourceto all referrer instances.voidClears all references to an instance.booleanisBound()Determines whether or not the reference has been bound.name()Gets the resource name.Gets the referrer type.toString()TypeTemplate<?, T> type()Gets the resource type
-
Constructor Details
-
ComponentResourceReference
ComponentResourceReference(DeclaredAttribute<R, ? super T> attribute, Resource resource) Constructor.- Parameters:
attribute- facade for the attribute backing the resourceresource- resource annotation associated with the attribute
-
-
Method Details
-
name
Description copied from interface:IuResourceReferenceGets the resource name.- Specified by:
namein interfaceIuResourceReference<R,T> - Returns:
- resource name
-
type
Description copied from interface:IuResourceReferenceGets the resource type- Specified by:
typein interfaceIuResourceReference<R,T> - Returns:
- resource type
-
referrerType
Description copied from interface:IuResourceReferenceGets the referrer type.- Specified by:
referrerTypein interfaceIuResourceReference<R,T> - Returns:
- referrer type
-
isBound
public boolean isBound()Description copied from interface:IuResourceReferenceDetermines whether or not the reference has been bound.- Specified by:
isBoundin interfaceIuResourceReference<R,T> - Returns:
- true if
boundwith a non-null resource; else false
-
bind
Description copied from interface:IuResourceReferenceBinds aresourceto all referrer instances.A reference to the bound resource will be provided to all referrer instances
acceptedprior to binding. Once bound, new referrer instances will be provided a reference to theresourcewhenaccepted.- Specified by:
bindin interfaceIuResourceReference<R,T> - Parameters:
resource-IuResourceto bind to the reference; may be null to unbind the reference
-
accept
Description copied from interface:IuResourceReferenceAccepts a referrer instance as abinding target. -
clear
Description copied from interface:InstanceReferenceClears all references to an instance.Reverses
Consumer.accept(Object).- Specified by:
clearin interfaceInstanceReference<R>- Parameters:
referrer- instance
-
toString
-