Package com.composum.sling.core.mapping
Class MappingRules
- java.lang.Object
-
- com.composum.sling.core.mapping.MappingRules
-
public class MappingRules extends Object
the set of rules for filtering during the resource hierarchy traversal - uses a DateParser instance which is not thread safe - instances of MappingRules are also not thread safe - use one single instance per thread! TODO: make it configurable via OSGi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MappingRules.ChangeRule
the change policy values - skip: for packages - skip one aspect (e.g.static class
MappingRules.ContentNodeType
static class
MappingRules.DateParser
static class
MappingRules.PropertyFormat
the settings set for property transformation
-
Field Summary
Fields Modifier and Type Field Description MappingRules.ChangeRule
changeRule
the change policystatic Charset
CHARSET
static String
CHILD_ORDER_NAME
the name for children names array (an optional and additional value to remember the right order of the children)static String
CONTENT_NODE_FILE_NAME
static String[]
DATE_PATTERNS
the set of provided Date formats for parsing from String valueMappingRules.DateParser
dateParser
the change policystatic ResourceFilter
DEFAULT_NODE_FILTER
the default filter for node traversal - system nodes, servlet paths and ACLs are disabledstatic NodeTreeServlet.TreeNodeStrategy
DEFAULT_TREE_NODE_STRATEGY
the default strategy for node traversalstatic String
ECMA_DATE_FORMAT
the default Date format for output and parsingStringFilter
exportPropertyFilter
the filter for the properties (their names) of a resourceStringFilter
importPropertyFilter
the filter for the properties (their names) of a resourcestatic String
MAP_DATE_FORMAT
the default Date format for output and parsingstatic StringFilter
MAPPING_EXPORT_FILTER
the default property name filter to restrict the export - all properties are exported by defaultstatic StringFilter
MAPPING_IMPORT_FILTER
the default property name filter to restrict the import - creation properties are disabledstatic ResourceFilter
MAPPING_NODE_FILTER
the default filter for export and import - system nodes and servlet paths are disabledint
maxDepth
the maximum depth for hierarchy traversal (0: infinity traversal)static String
PROPERTIES_NAME
the name for the set of property objects in the external view to a resourceMappingRules.PropertyFormat
propertyFormat
the format for the properties in the JSON textResourceFilter
resourceFilter
the filter for the resources in the hierarchystatic StringFilter
SOURCE_EXPORT_FILTER
the property name filter to ignore automatic or transient properties not useful in source codestatic Pattern
TYPED_PROPERTY_STRING
the name for the set of properties in the JSON view to a resource
-
Constructor Summary
Constructors Constructor Description MappingRules(ResourceFilter resourceFilter, StringFilter exportPropertyFilter, StringFilter importPropertyFilter, MappingRules.PropertyFormat propertyFormat, Integer maxDepth, MappingRules.ChangeRule changeRule)
Generates a resource traversal filter for generation JSON objects.MappingRules(MappingRules template, ResourceFilter resourceFilter, StringFilter exportPropertyFilter, StringFilter importPropertyFilter, MappingRules.PropertyFormat propertyFormat, Integer maxDepth, MappingRules.ChangeRule changeRule)
the copy constructor to clone and modify rules partially
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MappingRules
getDefaultMappingRules()
the default rule set for general import an export features
-
-
-
Field Detail
-
CONTENT_NODE_FILE_NAME
public static final String CONTENT_NODE_FILE_NAME
- See Also:
- Constant Field Values
-
CHARSET
public static final Charset CHARSET
-
MAP_DATE_FORMAT
public static final String MAP_DATE_FORMAT
the default Date format for output and parsing- See Also:
- Constant Field Values
-
ECMA_DATE_FORMAT
public static final String ECMA_DATE_FORMAT
the default Date format for output and parsing- See Also:
- Constant Field Values
-
DATE_PATTERNS
public static final String[] DATE_PATTERNS
the set of provided Date formats for parsing from String value
-
TYPED_PROPERTY_STRING
public static final Pattern TYPED_PROPERTY_STRING
the name for the set of properties in the JSON view to a resource
-
PROPERTIES_NAME
public static final String PROPERTIES_NAME
the name for the set of property objects in the external view to a resource- See Also:
- Constant Field Values
-
CHILD_ORDER_NAME
public static final String CHILD_ORDER_NAME
the name for children names array (an optional and additional value to remember the right order of the children)- See Also:
- Constant Field Values
-
DEFAULT_NODE_FILTER
public static final ResourceFilter DEFAULT_NODE_FILTER
the default filter for node traversal - system nodes, servlet paths and ACLs are disabled
-
DEFAULT_TREE_NODE_STRATEGY
public static final NodeTreeServlet.TreeNodeStrategy DEFAULT_TREE_NODE_STRATEGY
the default strategy for node traversal
-
MAPPING_NODE_FILTER
public static final ResourceFilter MAPPING_NODE_FILTER
the default filter for export and import - system nodes and servlet paths are disabled
-
MAPPING_EXPORT_FILTER
public static final StringFilter MAPPING_EXPORT_FILTER
the default property name filter to restrict the export - all properties are exported by default
-
SOURCE_EXPORT_FILTER
public static final StringFilter SOURCE_EXPORT_FILTER
the property name filter to ignore automatic or transient properties not useful in source code
-
MAPPING_IMPORT_FILTER
public static final StringFilter MAPPING_IMPORT_FILTER
the default property name filter to restrict the import - creation properties are disabled
-
resourceFilter
public final ResourceFilter resourceFilter
the filter for the resources in the hierarchy
-
exportPropertyFilter
public final StringFilter exportPropertyFilter
the filter for the properties (their names) of a resource
-
importPropertyFilter
public final StringFilter importPropertyFilter
the filter for the properties (their names) of a resource
-
propertyFormat
public final MappingRules.PropertyFormat propertyFormat
the format for the properties in the JSON text
-
maxDepth
public final int maxDepth
the maximum depth for hierarchy traversal (0: infinity traversal)
-
changeRule
public final MappingRules.ChangeRule changeRule
the change policy
-
dateParser
public final MappingRules.DateParser dateParser
the change policy
-
-
Constructor Detail
-
MappingRules
public MappingRules(ResourceFilter resourceFilter, StringFilter exportPropertyFilter, StringFilter importPropertyFilter, MappingRules.PropertyFormat propertyFormat, Integer maxDepth, MappingRules.ChangeRule changeRule)
Generates a resource traversal filter for generation JSON objects.- Parameters:
resourceFilter
- the filter for the resources in the hierarchyexportPropertyFilter
- the filter for the properties (their names) of a resourceimportPropertyFilter
- the filter for the properties (their names) of a resourcemaxDepth
- the maximum depth for hierarchy traversal (0: infinity traversal)
-
MappingRules
public MappingRules(MappingRules template, ResourceFilter resourceFilter, StringFilter exportPropertyFilter, StringFilter importPropertyFilter, MappingRules.PropertyFormat propertyFormat, Integer maxDepth, MappingRules.ChangeRule changeRule)
the copy constructor to clone and modify rules partially- Parameters:
template
- the template with all the default settings
-
-
Method Detail
-
getDefaultMappingRules
public static MappingRules getDefaultMappingRules()
the default rule set for general import an export features
-
-