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 char | _pathSeparatorEscapeChar
Default escape character to use for single character path separators , enabling the pathSeparator to be included in a segment. |
| protected String | _prefix
Optional prefix to strip and append to key names. |
| protected transient 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 startMarker index endMarker |
| protected static final Markers | |
| protected static final JavaPropsSchema | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private <V> boolean | |
| public static JavaPropsSchema | |
| public int | |
| public String | getSchemaType()
Implements com. Method that can be used to get an identifier that can be used for diagnostics purposes, to indicate what kind of data format this schema is used for: typically it is a short name of format itself, but it can also contain additional information in cases where data format supports multiple types of schemas. |
| public String | |
| public Markers | |
| public String | |
| public String | |
| public String | |
| public boolean | |
| public String | |
| public char | |
| public JPropPathSplitter | pathSplitter()
Accessor for getting a |
| public String | |
| public JavaPropsSchema | |
| public 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. |
| public JavaPropsSchema | |
| public JavaPropsSchema | |
| public JavaPropsSchema | |
| public JavaPropsSchema | |
| public JavaPropsSchema | |
| public JavaPropsSchema | |
| public JavaPropsSchema | |
| public 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 |
| public JavaPropsSchema | |
| public JavaPropsSchema | withPathSeparator(String v)
Mutant factory method for constructing a new instance with specified path separator; default being comma ("."). |
| public JavaPropsSchema | withPathSeparatorEscapeChar(char v)
Mutant factory method for constructing a new instance with a different escape character to use for single character path separators , enabling the pathSeparator to be included in a segment. |
| public JavaPropsSchema | withPrefix(String v)
Mutant factory for constructing schema instance where specified prefix is prepended before logical path when generator writes output and removed by parser before binding back as properties. |
| public JavaPropsSchema | |
| public boolean |
| _firstArrayOffset | back to summary |
|---|---|
| protected int _firstArrayOffset Specifies index number used when writing the first array entry (which in Java has index of 0). After this initial value, additional elements will have consecutive values, incremented by 1. Note that this setting has no effect on reading: input indexes are only used for sorting values, and their exact values have no meaning. Default value is 1. | |
| _header | back to summary |
|---|---|
| protected String _header Optional header to prepend before any other output: typically a comment section or so. Note that contents here are NOT modified in any way, meaning that any comment indicators (leading '#' or '!') and linefeeds MUST be specified by caller. | |
| _indexMarker | back to summary |
|---|---|
| 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. Default value of "[" is usually combined with end marker of "]" to allow C/Java-style bracket notation, like "settings.path[1]". | |
| _keyValueSeparator | back to summary |
|---|---|
| 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". Default value is a single '=' character with no white spaces around | |
| _lineEnding | back to summary |
|---|---|
| protected String _lineEnding String added after value, including at least one linefeed. Default value is the 'Unix linefeed'. | |
| _lineIndentation | back to summary |
|---|---|
| protected String _lineIndentation String prepended before key value, as possible indentation | |
| _parseSimpleIndexes | back to summary |
|---|---|
| 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.
Note that this settings does NOT control whether "start/end marker" indicated
indexes are enabled or not; those depend on
Default value is | |
| _pathSeparator | back to summary |
|---|---|
| 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). | |
| _pathSeparatorEscapeChar | back to summary |
|---|---|
| protected char _pathSeparatorEscapeChar Default escape character to use for single character path separators , enabling the pathSeparator to be included in a segment. Note that this is only used if the path separator is a single character. The default value is NULL ('\0') which effectively disables escape processing. The escape character is only used for escaping either the pathSeparator character or a sequence of escape characters immediately prior to the pathSeparator. i.e., if the pathSeparator is "." and the escape char is '#' then "a#.b" produces a segment called "a.b", but "a##.b" produces a segment called "a#" with a child called "b" and "a###.b" produces a segment called "a#.b". Finally, "a#b" produces a segment called "a#b" - the escape processing is only used immediately prior to the path separator. Any escape character may be used. Backslash ('\\') is the most obvious candidate but be aware that the JDK Properties loader has its own rules for escape processing (documented in the Javadoc for Properties.load ) that will remove ALL duplicated backslash characters (and also carry out other escape handling) before the JavaPropsMapper gets to see them.
| |
| _prefix | back to summary |
|---|---|
| protected String _prefix Optional prefix to strip and append to key names. Useful when subset of properties need to be processed.
| |
| _splitter | back to summary |
|---|---|
| protected transient JPropPathSplitter _splitter Since splitter instances are slightly costly to build in some cases, we will lazily instantiate and cache them. | |
| _writeIndexUsingMarkers | back to summary |
|---|---|
| protected boolean _writeIndexUsingMarkers Whether array-element paths are written using start/end markers
(see 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. | |
| DEFAULT_INDEX_MARKER | back to summary |
|---|---|
| protected static final Markers DEFAULT_INDEX_MARKER | |
| EMPTY | back to summary |
|---|---|
| protected static final JavaPropsSchema EMPTY | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| JavaPropsSchema | back to summary |
|---|---|
| public JavaPropsSchema() | |
| JavaPropsSchema | back to summary |
|---|---|
| public JavaPropsSchema(JavaPropsSchema base) | |
| _equals | back to summary |
|---|---|
| private <V> boolean _equals(V a, V b) | |
| emptySchema | back to summary |
|---|---|
| public static JavaPropsSchema emptySchema() | |
| firstArrayOffset | back to summary |
|---|---|
| public int firstArrayOffset() | |
| getSchemaType | back to summary |
|---|---|
| public String getSchemaType() Implements com. Doc from com. Method that can be used to get an identifier that can be used for diagnostics purposes, to indicate what kind of data format this schema is used for: typically it is a short name of format itself, but it can also contain additional information in cases where data format supports multiple types of schemas. | |
| header | back to summary |
|---|---|
| public String header() | |
| indexMarker | back to summary |
|---|---|
| public Markers indexMarker() | |
| keyValueSeparator | back to summary |
|---|---|
| public String keyValueSeparator() | |
| lineEnding | back to summary |
|---|---|
| public String lineEnding() | |
| lineIndentation | back to summary |
|---|---|
| public String lineIndentation() | |
| parseSimpleIndexes | back to summary |
|---|---|
| public boolean parseSimpleIndexes() | |
| pathSeparator | back to summary |
|---|---|
| public String pathSeparator() | |
| pathSeparatorEscapeChar | back to summary |
|---|---|
public char pathSeparatorEscapeChar()
| |
| pathSplitter | back to summary |
|---|---|
| public JPropPathSplitter pathSplitter() Accessor for getting a Note that instance is constructed lazily as needed, but reused afterwards for this instance (and for these specific settings). | |
| prefix | back to summary |
|---|---|
public String prefix()
| |
| withFirstArrayOffset | back to summary |
|---|---|
| public JavaPropsSchema withFirstArrayOffset(int v) | |
| withHeader | back to summary |
|---|---|
| public 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. Note that caller must specify any and all linefeeds to use: generator will NOT modify header String contents in any way, and will not append a linefeed after contents (if any). | |
| withIndexMarker | back to summary |
|---|---|
| public JavaPropsSchema withIndexMarker(Markers v) | |
| withKeyValueSeparator | back to summary |
|---|---|
| public JavaPropsSchema withKeyValueSeparator(String v) | |
| withLineEnding | back to summary |
|---|---|
| public JavaPropsSchema withLineEnding(String v) | |
| withLineIndentation | back to summary |
|---|---|
| public JavaPropsSchema withLineIndentation(String v) | |
| withoutHeader | back to summary |
|---|---|
| public JavaPropsSchema withoutHeader() Convenience method, functionally equivalent to:
withHeader("")
used to ensure that no header is prepended before actual property values
are output.
| |
| withoutIndexMarker | back to summary |
|---|---|
| public JavaPropsSchema withoutIndexMarker() | |
| withoutLineIndentation | back to summary |
|---|---|
public JavaPropsSchema withoutLineIndentation()
| |
| withoutPathSeparator | back to summary |
|---|---|
| public 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 | |
| withParseSimpleIndexes | back to summary |
|---|---|
| public JavaPropsSchema withParseSimpleIndexes(boolean v) | |
| withPathSeparator | back to summary |
|---|---|
| public JavaPropsSchema withPathSeparator(String v) Mutant factory method for constructing a new instance with
specified path separator; default being comma (".").
Note that setting separator to `null` or empty String will
basically disable handling of nesting, similar to
calling | |
| withPathSeparatorEscapeChar | back to summary |
|---|---|
| public JavaPropsSchema withPathSeparatorEscapeChar(char v) Mutant factory method for constructing a new instance with a different escape character to use for single character path separators , enabling the pathSeparator to be included in a segment. Note that this is only used if the path separator is a single character. The default value is NULL ('\0') which effectively disables escape processing. The escape character is only used for escaping either the pathSeparator character or a sequence of escape characters immediately prior to the pathSeparator. i.e., if the pathSeparator is "." and the escape char is '#' then "a#.b" produces a segment called "a.b", but "a##.b" produces a segment called "a#" with a child called "b" and "a###.b" produces a segment called "a#.b". Finally, "a#b" produces a segment called "a#b" - the escape processing is only used immediately prior to the path separator. Any escape character may be used. Backslash ('\\') is the most obvious candidate but be aware that the JDK Properties loader has its own rules for escape processing (documented in the Javadoc for Properties.load ) that will remove ALL duplicated backslash characters (and also carry out other escape handling) before the JavaPropsMapper gets to see them.
| |
| withPrefix | back to summary |
|---|---|
| public JavaPropsSchema withPrefix(String v) Mutant factory for constructing schema instance where specified prefix is prepended before logical path when generator writes output and removed by parser before binding back as properties.
| |
| withWriteIndexUsingMarkers | back to summary |
|---|---|
| public JavaPropsSchema withWriteIndexUsingMarkers(boolean v) | |
| writeIndexUsingMarkers | back to summary |
|---|---|
| public boolean writeIndexUsingMarkers() | |