public class ProjectionDefinitionConfiguration extends Object implements ProjectionDefinitions
Constructor and Description |
---|
ProjectionDefinitionConfiguration()
Creates a new
ProjectionDefinitionConfiguration . |
ProjectionDefinitionConfiguration(Iterable<ResourceMetadata> resourceMetadata)
Creates a new
ProjectionDefinitionConfiguration from the given ResourceMetadata instances. |
Modifier and Type | Method and Description |
---|---|
ProjectionDefinitionConfiguration |
addProjection(Class<?> projectionType)
Adds the given projection type to the configuration.
|
ProjectionDefinitionConfiguration |
addProjection(Class<?> projectionType,
Class<?>... sourceTypes)
Adds a projection type for the given source types.
|
ProjectionDefinitionConfiguration |
addProjection(Class<?> projectionType,
String name,
Class<?>... sourceTypes)
Adds the given projection type for the given source types under the given name.
|
String |
getParameterName()
Returns the request parameter to be used to expose the projection to the web.
|
Map<String,Class<?>> |
getProjectionsFor(Class<?> sourceType)
Returns all projections registered for the given source type.
|
Class<?> |
getProjectionType(Class<?> sourceType,
String name)
Returns the projection type for the given source type and name.
|
boolean |
hasProjectionFor(Class<?> sourceType)
Returns whether we have a projection registered for the given source type.
|
void |
setParameterName(String parameterName)
Configures the request parameter name to be used to accept the projection name to be returned.
|
public ProjectionDefinitionConfiguration()
ProjectionDefinitionConfiguration
.public ProjectionDefinitionConfiguration(Iterable<ResourceMetadata> resourceMetadata)
ProjectionDefinitionConfiguration
from the given ResourceMetadata
instances.resourceMetadata
- must not be null.public String getParameterName()
ProjectionDefinitions
getParameterName
in interface ProjectionDefinitions
public void setParameterName(String parameterName)
parameterName
- defaults to , will
be set back to this default if null or an empty value is configured.public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType)
Projection
for
additional metadata.projectionType
- must not be null.Projection
public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType, Class<?>... sourceTypes)
projectionType
- must not be null.sourceTypes
- must not be null or empty.public ProjectionDefinitionConfiguration addProjection(Class<?> projectionType, String name, Class<?>... sourceTypes)
projectionType
- must not be null.name
- must not be null or empty.sourceTypes
- must not be null or empty.public Class<?> getProjectionType(Class<?> sourceType, String name)
ProjectionDefinitions
getProjectionType
in interface ProjectionDefinitions
sourceType
- must not be null.name
- must not be null or empty.public boolean hasProjectionFor(Class<?> sourceType)
ProjectionDefinitions
hasProjectionFor
in interface ProjectionDefinitions
sourceType
- must not be null.Copyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.