public class ResourceInspector extends Object
| Constructor and Description |
|---|
ResourceInspector() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Pair<String,Method>> |
findEmbeddedResources(Class<?> anyClass)
For a given class, looks for @EmbeddedEntityResource annotations, using the annotation produce
a Map of the property name key and the entity key
|
static String |
findEntityCollectionNameName(ResourceMetadata meta)
Finds the name of the entity collection using the meta information.
|
protected static String |
findEntityName(EntityResource entityAnnot)
Finds the name of the entity using its annotation.
|
protected static String |
findEntityNameByAnnotationAttributes(Map<String,Object> annotAttribs)
Finds the name of the entity using its annotation.
|
static Method |
findMethod(Class<? extends ResourceAction> resourceInterfaceWithOneMethod,
Class<?> resource)
Returns the method for the interface
|
static String |
findUniqueId(Object obj)
Finds the unique id of an object using the @UniqueId annotation.
|
static Method |
findUniqueIdMethod(Class<?> objClass)
Finds a single method with the @UniqueId annotation.
|
static String |
findUniqueIdName(Method uniqueIdMethod)
Finds the property name that is used as the unique id.
|
static List<ResourceMetadata> |
inspect(Class resource)
Inspects the annotated resource to understand its capabilities
|
static void |
inspectAddressedProperties(Api api,
Class<?> resource,
String entityPath,
List<ResourceMetadata> metainfo)
Inspects the entity resource and returns meta data about any addresssed/binary properties
|
static Api |
inspectApi(Class<?> resource)
Inspects the resource to determine what api it belongs to.
|
static ResourceOperation |
inspectOperation(Class<?> resource,
Method aMethod,
org.springframework.http.HttpMethod httpMethod)
Inspects the method and returns meta data about its operations
|
static boolean |
isDeleted(Method method)
Returns true if the method has been marked as deleted.
|
public static void inspectAddressedProperties(Api api, Class<?> resource, String entityPath, List<ResourceMetadata> metainfo)
api - public static ResourceOperation inspectOperation(Class<?> resource, Method aMethod, org.springframework.http.HttpMethod httpMethod)
resource - aMethod - httpMethod - defaultParams - public static boolean isDeleted(Method method)
method - the methodpublic static Method findMethod(Class<? extends ResourceAction> resourceInterfaceWithOneMethod, Class<?> resource)
resourceInterfaceWithOneMethod - resource - protected static String findEntityNameByAnnotationAttributes(Map<String,Object> annotAttribs)
annotAttribs - protected static String findEntityName(EntityResource entityAnnot)
entityAnnot - public static String findEntityCollectionNameName(ResourceMetadata meta)
entityAnnot - public static Map<String,Pair<String,Method>> findEmbeddedResources(Class<?> anyClass)
anyClass - public static Api inspectApi(Class<?> resource)
resource - public static List<ResourceMetadata> inspect(Class resource)
resource - public static String findUniqueId(Object obj)
obj - any objectpublic static Method findUniqueIdMethod(Class<?> objClass) throws IllegalArgumentException
obj - any objectIllegalArgumentException - if there is is more than 1 method annotated with @UniqueIdCopyright © 2005–2014 Alfresco Software. All rights reserved.