Package jodd.props

Class PropsParser

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class PropsParser
    extends java.lang.Object
    implements java.lang.Cloneable
    Props parser.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  PropsParser.Operator
      Different assignment operators.
      protected static class  PropsParser.ParseState
      Parsing states.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void add​(java.lang.String section, java.lang.String key, java.lang.StringBuilder value, boolean trim, PropsParser.Operator operator)
      Adds accumulated value to key and current section.
      PropsParser clone()  
      protected void extractProfilesAndAdd​(java.lang.String key, java.lang.String value, PropsParser.Operator operator)
      Extracts profiles from the key name and adds key-value to them.
      PropsData getPropsData()  
      protected void justAdd​(java.lang.String key, java.lang.String value, java.util.ArrayList<java.lang.String> keyProfiles, PropsParser.Operator operator)
      Core key-value addition.
      void parse​(java.lang.String in)
      Loads properties.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • propsData

        protected final PropsData propsData
      • escapeNewLineValue

        protected java.lang.String escapeNewLineValue
        Value that will be inserted when escaping the new line.
      • valueTrimLeft

        protected boolean valueTrimLeft
        Trims left the value.
      • valueTrimRight

        protected boolean valueTrimRight
        Trims right the value.
      • ignorePrefixWhitespacesOnNewLine

        protected boolean ignorePrefixWhitespacesOnNewLine
        Defines if starting whitespaces when value is split in the new line should be ignored or not.
      • multilineValues

        protected boolean multilineValues
        Defines if multi-line values may be written using triple-quotes as in python.
      • skipEmptyProps

        protected boolean skipEmptyProps
        Don't include empty properties.
    • Constructor Detail

      • PropsParser

        public PropsParser()
      • PropsParser

        public PropsParser​(PropsData propsData)
    • Method Detail

      • getPropsData

        public PropsData getPropsData()
      • clone

        public PropsParser clone()
        Overrides:
        clone in class java.lang.Object
      • parse

        public void parse​(java.lang.String in)
        Loads properties.
      • add

        protected void add​(java.lang.String section,
                           java.lang.String key,
                           java.lang.StringBuilder value,
                           boolean trim,
                           PropsParser.Operator operator)
        Adds accumulated value to key and current section.
      • extractProfilesAndAdd

        protected void extractProfilesAndAdd​(java.lang.String key,
                                             java.lang.String value,
                                             PropsParser.Operator operator)
        Extracts profiles from the key name and adds key-value to them.
      • justAdd

        protected void justAdd​(java.lang.String key,
                               java.lang.String value,
                               java.util.ArrayList<java.lang.String> keyProfiles,
                               PropsParser.Operator operator)
        Core key-value addition.