Class ObjectMapping
- java.lang.Object
-
- com.composum.sling.core.mapping.jcr.ObjectMapping
-
public class ObjectMapping extends Object
Created by rw on 19.05.15.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ObjectMapping.MappingStrategy<T>
static class
ObjectMapping.ObjectFilter
accepts all resources which can be mapped to object by this mapperstatic class
ObjectMapping.ResourceFilterStrategy
static class
ObjectMapping.StringFilterStrategy
-
Field Summary
Fields Modifier and Type Field Description protected static List<ResourceFilter>
FROM_RESOURCE_FILTERS
protected static List<ObjectMapping.MappingStrategy>
FROM_RESOURCE_STRATEGIES
static ObjectMapping.ObjectFilter
OBJECT_FILTER
protected static ResourceFilter
RESOURCE_FILTER_FILTER
protected static ObjectMapping.ResourceFilterStrategy
RESOURCE_FILTER_STRATEGY
protected static ResourceFilter
STRING_FILTER_FILTER
protected static ObjectMapping.StringFilterStrategy
STRING_FILTER_STRATEGY
protected static Map<Class<?>,ObjectMapping.MappingStrategy>
TO_RESOURCE_STRATEGIES
-
Constructor Summary
Constructors Constructor Description ObjectMapping()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
fromResource(org.apache.sling.api.resource.Resource resource)
static ObjectMapping.MappingStrategy
getStrategy(Class<?> objectType)
static ObjectMapping.MappingStrategy
getStrategy(org.apache.sling.api.resource.Resource resource)
static void
toResource(org.apache.sling.api.resource.Resource resource, Object object)
-
-
-
Field Detail
-
OBJECT_FILTER
public static final ObjectMapping.ObjectFilter OBJECT_FILTER
-
RESOURCE_FILTER_FILTER
protected static final ResourceFilter RESOURCE_FILTER_FILTER
-
STRING_FILTER_FILTER
protected static final ResourceFilter STRING_FILTER_FILTER
-
RESOURCE_FILTER_STRATEGY
protected static final ObjectMapping.ResourceFilterStrategy RESOURCE_FILTER_STRATEGY
-
STRING_FILTER_STRATEGY
protected static final ObjectMapping.StringFilterStrategy STRING_FILTER_STRATEGY
-
FROM_RESOURCE_FILTERS
protected static final List<ResourceFilter> FROM_RESOURCE_FILTERS
-
FROM_RESOURCE_STRATEGIES
protected static final List<ObjectMapping.MappingStrategy> FROM_RESOURCE_STRATEGIES
-
TO_RESOURCE_STRATEGIES
protected static final Map<Class<?>,ObjectMapping.MappingStrategy> TO_RESOURCE_STRATEGIES
-
-
Method Detail
-
fromResource
public static Object fromResource(org.apache.sling.api.resource.Resource resource) throws Exception
- Throws:
Exception
-
toResource
public static void toResource(org.apache.sling.api.resource.Resource resource, Object object) throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
getStrategy
public static ObjectMapping.MappingStrategy getStrategy(org.apache.sling.api.resource.Resource resource)
-
getStrategy
public static ObjectMapping.MappingStrategy getStrategy(Class<?> objectType)
-
-