Package org.snakeyaml.engine.v2.emitter
Class ScalarAnalysis
java.lang.Object
org.snakeyaml.engine.v2.emitter.ScalarAnalysis
Accumulate information to choose the scalar style
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final boolean
private final boolean
private final boolean
private final boolean
private final boolean
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionScalarAnalysis
(String scalar, boolean empty, boolean multiline, boolean allowFlowPlain, boolean allowBlockPlain, boolean allowSingleQuoted, boolean allowBlock) Create -
Method Summary
Modifier and TypeMethodDescriptiongetterboolean
getterboolean
getterboolean
getterboolean
getterboolean
isEmpty()
getterboolean
getter
-
Field Details
-
scalar
-
empty
private final boolean empty -
multiline
private final boolean multiline -
allowFlowPlain
private final boolean allowFlowPlain -
allowBlockPlain
private final boolean allowBlockPlain -
allowSingleQuoted
private final boolean allowSingleQuoted -
allowBlock
private final boolean allowBlock
-
-
Constructor Details
-
ScalarAnalysis
public ScalarAnalysis(String scalar, boolean empty, boolean multiline, boolean allowFlowPlain, boolean allowBlockPlain, boolean allowSingleQuoted, boolean allowBlock) Create- Parameters:
scalar
- - the data to analyseempty
- - true for empty scalarmultiline
- - true if it may take many linesallowFlowPlain
- - true if can be plain in flow contextallowBlockPlain
- - true if can be plain in block contextallowSingleQuoted
- - true if single quotes are allowedallowBlock
- - true if block style is alowed
-
-
Method Details
-
getScalar
getter- Returns:
- the scalar to be analysed
-
isEmpty
public boolean isEmpty()getter- Returns:
- true when empty
-
isMultiline
public boolean isMultiline()getter- Returns:
- true if it may take many lines
-
isAllowFlowPlain
public boolean isAllowFlowPlain()getter- Returns:
- true if can be plain in flow context
-
isAllowBlockPlain
public boolean isAllowBlockPlain()getter- Returns:
- true if can be plain in block context
-
isAllowSingleQuoted
public boolean isAllowSingleQuoted()getter- Returns:
- true if single quotes are allowed
-
isAllowBlock
public boolean isAllowBlock()getter- Returns:
- true when block style is allowed for this scalar
-