org.skyscreamer.yoga.configuration
Class YogaEntityConfiguration<T>

java.lang.Object
  extended by org.skyscreamer.yoga.configuration.YogaEntityConfiguration<T>
Direct Known Subclasses:
SimpleYogaEntityConfiguration

public abstract class YogaEntityConfiguration<T>
extends Object

Interface for a class that configures an entity. An implementation of this interface must return the class being configured. It can be used instead of or in conjunction with entity-level annotations.

See Also:
SimpleYogaEntityConfiguration, Core

Constructor Summary
YogaEntityConfiguration()
           
 
Method Summary
 Collection<String> getCoreFields()
          Returns a collection of core fields for an entity.
 Class<T> getEntityClass()
          Identifies the class supported by this configuration.
 List<Method> getExtraFieldMethods()
          This method returns a list of valid extra field methods on this object.
 List<String> getExtraFieldNames()
          This method returns a list of the field names for @ExtraField methods in this object.
 Collection<Property<T>> getProperties()
          Returns a collection of fields that can be selected on an entity similar to getSelectableFields().
 Collection<String> getSelectableFields()
          Returns a collection of fields that can be selected on an entity.
 String getURITemplate()
          Specifies the template for the URL represented by this entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YogaEntityConfiguration

public YogaEntityConfiguration()
Method Detail

getEntityClass

public Class<T> getEntityClass()
Identifies the class supported by this configuration.

Returns:
A class object for the entity being configured

getCoreFields

public Collection<String> getCoreFields()
Returns a collection of core fields for an entity. Core fields are returned by default, and do not require a selector. If an empty collection is returned no fields are considered core. If a null is returned, this setting will be ignored and the entity will be analyzed for core annotations. Except in the case of a null being returned, this configuration overrides (rather than extends) the entity configuration.

Returns:
The collection of core field names

getProperties

public Collection<Property<T>> getProperties()
Returns a collection of fields that can be selected on an entity similar to getSelectableFields(). This gives you the opportunity to use a serialization method other than reflection.

Returns:
The collection of Property objects used for serialization
See Also:
Property

getSelectableFields

public Collection<String> getSelectableFields()
Returns a collection of fields that can be selected on an entity. If an empty collection is return, nothing can be selected. If a null is returned, this setting is ignored, and all getters on an entity and extra fields can be selected.

Returns:

getURITemplate

public String getURITemplate()
Specifies the template for the URL represented by this entity. This overrides any definition of @URITemplate in the entity itself. If this method returns null, it will default back to entity-specified behavior.

Returns:
A URITemplate, or null if the entity should be examined for the template value.

getExtraFieldMethods

public List<Method> getExtraFieldMethods()
This method returns a list of valid extra field methods on this object. A valid field must: 1. Be annotated with @ExtraField 2. Take either no parameters, or a single parameter with the entity supported by the configuration

Returns:
A list of method objects

getExtraFieldNames

public List<String> getExtraFieldNames()
This method returns a list of the field names for @ExtraField methods in this object.

Returns:
A list of string field names


Copyright © 2013. All Rights Reserved.