public class DefaultProjectionFactory extends Object implements com.broadleafcommerce.common.extension.projection.ProjectionFactory
ProjectionFactory
Constructor and Description |
---|
DefaultProjectionFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) |
Modifier and Type | Method and Description |
---|---|
Class<?> |
createProjection(Class<?> repositoryDomain) |
Class<?> |
createProjection(Class<?> repositoryDomain,
String projectionName) |
Class<?> |
getExistingProjectionType(Class<?> repositoryDomain) |
protected Class<?> |
getExistingProjectionType(Class<?> repositoryDomain,
boolean onlyIfDerived)
Try to ascertain if a known projection type already exists for the specified domain class.
|
static Class<?> |
getProjectionType(Class<?> repositoryDomain)
Provides basic detection of projection type based on if the entity class implements
BusinessTypeAware . |
protected boolean |
shouldIgnore(Field field)
Whether or not the field from the domain class should be ignored and not copied into the
projection.
|
protected boolean |
shouldProject(Class<?> type)
Whether or not the type for a field warrants a projection class.
|
public DefaultProjectionFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
public Class<?> createProjection(Class<?> repositoryDomain)
createProjection
in interface com.broadleafcommerce.common.extension.projection.ProjectionFactory
public Class<?> createProjection(Class<?> repositoryDomain, String projectionName)
createProjection
in interface com.broadleafcommerce.common.extension.projection.ProjectionFactory
public Class<?> getExistingProjectionType(Class<?> repositoryDomain)
getExistingProjectionType
in interface com.broadleafcommerce.common.extension.projection.ProjectionFactory
public static Class<?> getProjectionType(Class<?> repositoryDomain)
BusinessTypeAware
.repositoryDomain
- The entity class to check for explicit projection declaration@Nullable protected Class<?> getExistingProjectionType(Class<?> repositoryDomain, boolean onlyIfDerived)
repositoryDomain
- The domain class to inspect for determination of a referenced
projection classonlyIfDerived
- Only attempt to determine the project type if it is explicitly declared
in the repositoryDomain class (not a super class). Otherwise, return null.protected boolean shouldProject(Class<?> type)
type
- The field type in the domain classprotected boolean shouldIgnore(Field field)
field
- The field to assess for inclusionCopyright © 2021. All rights reserved.