Class ScalarAnalysis


  • public final class ScalarAnalysis
    extends java.lang.Object
    Accumulate information to choose the scalar style
    • Field Detail

      • scalar

        private final java.lang.String 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 Detail

      • ScalarAnalysis

        public ScalarAnalysis​(java.lang.String scalar,
                              boolean empty,
                              boolean multiline,
                              boolean allowFlowPlain,
                              boolean allowBlockPlain,
                              boolean allowSingleQuoted,
                              boolean allowBlock)
        Create
        Parameters:
        scalar - - the data to analyse
        empty - - true for empty scalar
        multiline - - true if it may take many lines
        allowFlowPlain - - true if can be plain in flow context
        allowBlockPlain - - true if can be plain in block context
        allowSingleQuoted - - true if single quotes are allowed
        allowBlock - - true if block style is alowed
    • Method Detail

      • getScalar

        public java.lang.String 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