public class JavaPropsSchema extends Object implements com.fasterxml.jackson.core.FormatSchema, Serializable
FormatSchema
sub-type that defines details of things like:
Modifier and Type | Field and Description |
---|---|
protected int |
_firstArrayOffset
Specifies index number used when writing the first array entry (which
in Java has index of 0).
|
protected String |
_header
Optional header to prepend before any other output: typically a
comment section or so.
|
protected Markers |
_indexMarker
Default start marker for index access, if any; empty String may be used
to indicate no marker-based index detection should be made.
|
protected String |
_keyValueSeparator
String added between key and value; needs to include the "equals character"
(either '=' or ':', both allowed by Java Properties specification), may
also include white before and/or after "equals character".
|
protected String |
_lineEnding
String added after value, including at least one linefeed.
|
protected String |
_lineIndentation
String prepended before key value, as possible indentation
|
protected boolean |
_parseSimpleIndexes
Whether 'simple' index-notation is supported for path segments or not:
simple meaning that if a path segment is a textual representation of
a non-negative integer value with length of 9 or less (that is, up to
but no including one billion), it will be considered index, not property
name.
|
protected String |
_pathSeparator
Default path separator to use for hierarchic paths, if any; empty
String may be used to indicate that no hierarchy should be inferred
using a simple separator (although index markers may still be used,
if defined).
|
protected JPropPathSplitter |
_splitter
Since splitter instances are slightly costly to build in some cases,
we will lazily instantiate and cache them.
|
protected boolean |
_writeIndexUsingMarkers
Whether array-element paths are written using start/end markers
(see
_indexMarker or
"simple" index number: if set to true AND markers
are specified as non-empty Strings, will use sequence of |
protected static Markers |
DEFAULT_INDEX_MARKER |
protected static JavaPropsSchema |
EMPTY |
Constructor and Description |
---|
JavaPropsSchema() |
JavaPropsSchema(JavaPropsSchema base) |
Modifier and Type | Method and Description |
---|---|
static JavaPropsSchema |
emptySchema() |
int |
firstArrayOffset() |
String |
getSchemaType() |
String |
header() |
Markers |
indexMarker() |
String |
keyValueSeparator() |
String |
lineEnding() |
String |
lineIndentation() |
boolean |
parseSimpleIndexes() |
String |
pathSeparator() |
JPropPathSplitter |
pathSplitter()
Accessor for getting a
JPropPathSplitter instance that does
splitting according to the settings of this instance. |
JavaPropsSchema |
withFirstArrayOffset(int v) |
JavaPropsSchema |
withHeader(String v)
Mutant factory for constructing schema instance where specified
header section (piece of text written out right before actual
properties entries) will be used.
|
JavaPropsSchema |
withIndexMarker(Markers v) |
JavaPropsSchema |
withKeyValueSeparator(String v) |
JavaPropsSchema |
withLineEnding(String v) |
JavaPropsSchema |
withLineIndentation(String v) |
JavaPropsSchema |
withoutHeader()
Convenience method, functionally equivalent to:
|
JavaPropsSchema |
withoutIndexMarker() |
JavaPropsSchema |
withoutLineIndentation() |
JavaPropsSchema |
withoutPathSeparator()
Mutant factory method for constructing a new instance that
specifies that no "path splitting" is to be done: this is
similar to default behavior of
Properties
in which keys are full Strings and there is no nesting of values. |
JavaPropsSchema |
withParseSimpleIndexes(boolean v) |
JavaPropsSchema |
withPathSeparator(String v)
Mutant factory method for constructing a new instance with
specified path separator; default being comma (".").
|
JavaPropsSchema |
withWriteIndexUsingMarkers(boolean v) |
boolean |
writeIndexUsingMarkers() |
protected static final Markers DEFAULT_INDEX_MARKER
protected static final JavaPropsSchema EMPTY
protected transient JPropPathSplitter _splitter
protected int _firstArrayOffset
Default value is 1.
protected String _pathSeparator
protected Markers _indexMarker
Default value of "[" is usually combined with end marker of "]" to allow C/Java-style bracket notation, like "settings.path[1]".
protected boolean _parseSimpleIndexes
Note that this settings does NOT control whether "start/end marker" indicated
indexes are enabled or not; those depend on _indexMarker
.
Default value is true
, "plain" index segments are
supported.
protected boolean _writeIndexUsingMarkers
_indexMarker
or
"simple" index number: if set to true
AND markers
are specified as non-empty Strings, will use sequence of
startMarker index endMarkerto include index in path; otherwise will simply use textual representation of the index number as path segment, prefixed by path separator as necessary.
protected String _lineIndentation
protected String _keyValueSeparator
protected String _lineEnding
protected String _header
public JavaPropsSchema()
public JavaPropsSchema(JavaPropsSchema base)
public JPropPathSplitter pathSplitter()
JPropPathSplitter
instance that does
splitting according to the settings of this instance.
Note that instance is constructed lazily as needed, but reused afterwards for this instance (and for these specific settings).
public JavaPropsSchema withFirstArrayOffset(int v)
public JavaPropsSchema withPathSeparator(String v)
withoutPathSeparator()
.public JavaPropsSchema withoutPathSeparator()
Properties
in which keys are full Strings and there is no nesting of values.public JavaPropsSchema withIndexMarker(Markers v)
public JavaPropsSchema withoutIndexMarker()
public JavaPropsSchema withParseSimpleIndexes(boolean v)
public JavaPropsSchema withWriteIndexUsingMarkers(boolean v)
public JavaPropsSchema withLineIndentation(String v)
public JavaPropsSchema withoutLineIndentation()
public JavaPropsSchema withKeyValueSeparator(String v)
public JavaPropsSchema withLineEnding(String v)
public JavaPropsSchema withHeader(String v)
public JavaPropsSchema withoutHeader()
withHeader("")used to ensure that no header is prepended before actual property values are output.
public String getSchemaType()
getSchemaType
in interface com.fasterxml.jackson.core.FormatSchema
public static JavaPropsSchema emptySchema()
public int firstArrayOffset()
public String header()
public Markers indexMarker()
public String lineEnding()
public String lineIndentation()
public String keyValueSeparator()
public boolean parseSimpleIndexes()
public String pathSeparator()
public boolean writeIndexUsingMarkers()
Copyright © 2017 FasterXML. All rights reserved.