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