com.atlassian.plugins.rest.common.expand.resolver
Class AbstractAnnotationEntityExpanderResolver

java.lang.Object
  extended by com.atlassian.plugins.rest.common.expand.resolver.AbstractAnnotationEntityExpanderResolver
All Implemented Interfaces:
EntityExpanderResolver

public abstract class AbstractAnnotationEntityExpanderResolver
extends java.lang.Object
implements EntityExpanderResolver

An EntityExpander resolver that uses the Expander annotation for resolution.

Implementation must implement getEntityExpander(Expander)


Constructor Summary
AbstractAnnotationEntityExpanderResolver()
           
 
Method Summary
protected abstract  EntityExpander<?> getEntityExpander(Expander expander)
          Retrieves the EntityExpander associated to the Expander annotation.
<T> EntityExpander<T>
getExpander(java.lang.Class<? extends T> type)
          Gets an EntityExpander for the given type.
 boolean hasExpander(java.lang.Class<?> type)
          Tells whether this resolver can get an expander for the given instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAnnotationEntityExpanderResolver

public AbstractAnnotationEntityExpanderResolver()
Method Detail

hasExpander

public boolean hasExpander(java.lang.Class<?> type)
Description copied from interface: EntityExpanderResolver
Tells whether this resolver can get an expander for the given instance.

Specified by:
hasExpander in interface EntityExpanderResolver
Parameters:
type - the type to resolve the expander for.
Returns:
true if an expander can be found for this object instance, false otherwise.

getExpander

public final <T> EntityExpander<T> getExpander(java.lang.Class<? extends T> type)
Description copied from interface: EntityExpanderResolver
Gets an EntityExpander for the given type.

Specified by:
getExpander in interface EntityExpanderResolver
Type Parameters:
T - the type of object to retrieve the expander for.
Parameters:
type - the type of object to look up the expander for.
Returns:
the EntityExpander, null if none could be found. This method will never return null if EntityExpanderResolver.hasExpander(Class) returns true for the same instance.

getEntityExpander

protected abstract EntityExpander<?> getEntityExpander(Expander expander)
Retrieves the EntityExpander associated to the Expander annotation. The entity expander is created if necessary.

Parameters:
expander - the annotation
Returns:
an instance of EntityExpander


Copyright © 2014 Atlassian. All Rights Reserved.