Forge - Resource Addon API 2.0.0.Alpha3

org.jboss.forge.resource
Interface ResourceGenerator<RESOURCETYPE,UNDERLYINGTYPE>

Type Parameters:
RESOURCETYPE - The Resource type generated by this implementation.
UNDERLYINGTYPE - The Class type of underlying object handled by Resource instances produced by this implementation.

public interface ResourceGenerator<RESOURCETYPE,UNDERLYINGTYPE>

Defines the mechanism for registering new Resource types.

Author:
Lincoln Baxter, III

Method Summary
<T extends Resource<UNDERLYINGTYPE>>
T
getResource(ResourceFactory factory, Class<RESOURCETYPE> type, UNDERLYINGTYPE resource)
          Get an instance of a Resource to handle the given Class type and object instance.
<T extends Resource<UNDERLYINGTYPE>>
Class<?>
getResourceType(Class<RESOURCETYPE> type, UNDERLYINGTYPE resource)
          Get the Resource type that will be generated for the given Class type and object instance.
 boolean handles(Class<?> type, Object resource)
          Returns true if the given object instance and Class type are handled by this ResourceGenerator
 

Method Detail

handles

boolean handles(Class<?> type,
                Object resource)
Returns true if the given object instance and Class type are handled by this ResourceGenerator


getResource

<T extends Resource<UNDERLYINGTYPE>> T getResource(ResourceFactory factory,
                                                   Class<RESOURCETYPE> type,
                                                   UNDERLYINGTYPE resource)
Get an instance of a Resource to handle the given Class type and object instance.


getResourceType

<T extends Resource<UNDERLYINGTYPE>> Class<?> getResourceType(Class<RESOURCETYPE> type,
                                                              UNDERLYINGTYPE resource)
Get the Resource type that will be generated for the given Class type and object instance.


Forge - Resource Addon API 2.0.0.Alpha3

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.