java.lang.Object
iu.type.ComponentResource<T>
- Type Parameters:
T- resource type
- All Implemented Interfaces:
IuResource<T>,Supplier<T>
Implementation of
IuResource;-
Method Summary
Modifier and TypeMethodDescription(package private) static ComponentResource<byte[]> createWebResource(String name, byte[] data) Creates a static web resource.Supplier<?> factory()Gets the factory to be used for creating new instances.voidProvides a factory to use for creating new instances of the resource.get()Gets the resource value.(package private) static Iterable<ComponentResource<?>> getResources(Class<?> targetClass) Gets all resources definitions tied to an implementation classname()Gets the resource name.booleanDetermines whether or not the resource should be authenticated before handing off to a managed application.booleanshared()Determines whether or not the resource is shared.toString()type()Gets the resource type
-
Method Details
-
createWebResource
Creates a static web resource.- Parameters:
name- namedata- content- Returns:
- static web resource
-
getResources
Gets all resources definitions tied to an implementation class- Parameters:
targetClass- class to check- Returns:
- resource definitions
-
needsAuthentication
public boolean needsAuthentication()Description copied from interface:IuResourceDetermines whether or not the resource should be authenticated before handing off to a managed application.- Specified by:
needsAuthenticationin interfaceIuResource<T>- Returns:
- true if the resource requires authentication; else false
-
name
Description copied from interface:IuResourceGets the resource name.- Specified by:
namein interfaceIuResource<T>- Returns:
- resource name
-
type
Description copied from interface:IuResourceGets the resource type- Specified by:
typein interfaceIuResource<T>- Returns:
- resource type
-
factory
Description copied from interface:IuResourceGets the factory to be used for creating new instances.By default, returns a
Supplierthat:- Returns
IuType.autoboxDefault()if theresource typeis an immutable single-value - Invokes
IuExecutable.exec(Object...)on an an internally managed implementation class orInvocationHandlersuitable for representing the resource
- Specified by:
factoryin interfaceIuResource<T>- Returns:
- factory that supplies new instance of the resource, or an
InvocationHandlerfor backing aProxy.
- Returns
-
factory
Description copied from interface:IuResourceProvides a factory to use for creating new instances of the resource.The factory may return:
- A direct instance of the
resource class. - A instance of a class that implements the
resource interface - An
InvocationHandlerto back aProxyfor theresource interface
To selective override default behavior, call
IuResource.factory()first to get a reference to the default factory.- Specified by:
factoryin interfaceIuResource<T>- Parameters:
factory- resource implementation factory.
- A direct instance of the
-
get
Description copied from interface:IuResourceGets the resource value.Provides a new or immutable instance when
IuResource.shared()returns false; may provide the same instance on subsequent calls whenIuResource.shared()returns true. -
toString
-