Class ParserOptions
- java.lang.Object
-
- org.apache.sling.contentparser.api.ParserOptions
-
@ProviderType public class ParserOptions extends java.lang.Object
Generic options for content parsers. Parser implementations can extend this class to provide additional options, valid only in the context of those implementations.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<java.lang.String>
DEFAULT_IGNORE_RESOURCE_NAMES
Default list of resource names that should be ignored.static java.lang.String
DEFAULT_PRIMARY_TYPE
Default primary type.static java.util.Set<java.lang.String>
DEFAULT_REMOVE_PROPERTY_NAME_PREFIXES
Default list of prefixes to remove from property names.
-
Constructor Summary
Constructors Constructor Description ParserOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParserOptions
defaultPrimaryType(java.lang.String value)
Default "jcr:primaryType" property for resources that have no explicit value for this value.ParserOptions
detectCalendarValues(boolean value)
Some content formats like JSON do not contain information to identify date/time values.java.lang.String
getDefaultPrimaryType()
java.util.Set<java.lang.String>
getIgnorePropertyNames()
java.util.Set<java.lang.String>
getIgnoreResourceNames()
java.util.Set<java.lang.String>
getRemovePropertyNamePrefixes()
ParserOptions
ignorePropertyNames(java.util.Set<java.lang.String> value)
Set a list of property names that should be ignored when parsing the content file.ParserOptions
ignoreResourceNames(java.util.Set<java.lang.String> value)
Set a list of resource/node names that should be ignored when parsing the content file.boolean
isDetectCalendarValues()
ParserOptions
removePropertyNamePrefixes(java.util.Set<java.lang.String> value)
Set a list of property name prefixes that should be removed automatically from the property name.
-
-
-
Field Detail
-
DEFAULT_PRIMARY_TYPE
public static final java.lang.String DEFAULT_PRIMARY_TYPE
Default primary type.- See Also:
- Constant Field Values
-
DEFAULT_REMOVE_PROPERTY_NAME_PREFIXES
public static final java.util.Set<java.lang.String> DEFAULT_REMOVE_PROPERTY_NAME_PREFIXES
Default list of prefixes to remove from property names.
-
DEFAULT_IGNORE_RESOURCE_NAMES
public static final java.util.Set<java.lang.String> DEFAULT_IGNORE_RESOURCE_NAMES
Default list of resource names that should be ignored.
-
-
Method Detail
-
defaultPrimaryType
public ParserOptions defaultPrimaryType(java.lang.String value)
Default "jcr:primaryType" property for resources that have no explicit value for this value. If set to null, not default type is applied.- Parameters:
value
- Default primary type.- Returns:
- this
-
getDefaultPrimaryType
public java.lang.String getDefaultPrimaryType()
-
detectCalendarValues
public ParserOptions detectCalendarValues(boolean value)
Some content formats like JSON do not contain information to identify date/time values. Instead they have to be detected by heuristics by trying to parse every string value. This mode is disabled by default.- Parameters:
value
- Activate calendar value detection- Returns:
- this
-
isDetectCalendarValues
public boolean isDetectCalendarValues()
-
ignorePropertyNames
public ParserOptions ignorePropertyNames(java.util.Set<java.lang.String> value)
Set a list of property names that should be ignored when parsing the content file.- Parameters:
value
- List of property names- Returns:
- this
-
getIgnorePropertyNames
public java.util.Set<java.lang.String> getIgnorePropertyNames()
-
ignoreResourceNames
public ParserOptions ignoreResourceNames(java.util.Set<java.lang.String> value)
Set a list of resource/node names that should be ignored when parsing the content file.- Parameters:
value
- List of resource/node names- Returns:
- this
-
getIgnoreResourceNames
public java.util.Set<java.lang.String> getIgnoreResourceNames()
-
removePropertyNamePrefixes
public ParserOptions removePropertyNamePrefixes(java.util.Set<java.lang.String> value)
Set a list of property name prefixes that should be removed automatically from the property name.- Parameters:
value
- List of property name prefixes- Returns:
- this
-
getRemovePropertyNamePrefixes
public java.util.Set<java.lang.String> getRemovePropertyNamePrefixes()
-
-