Class 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
    • Field Detail

      • 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
      • 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
      • maxDepth

        public final int maxDepth
        the maximum depth for hierarchy traversal (0: infinity traversal)
    • 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 hierarchy
        exportPropertyFilter - the filter for the properties (their names) of a resource
        importPropertyFilter - the filter for the properties (their names) of a resource
        maxDepth - the maximum depth for hierarchy traversal (0: infinity traversal)
    • Method Detail

      • getDefaultMappingRules

        public static MappingRules getDefaultMappingRules()
        the default rule set for general import an export features