Class FormattingOptions

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​org.eclipse.lsp4j.jsonrpc.messages.Either3<java.lang.String,​java.lang.Number,​java.lang.Boolean>>

    public class FormattingOptions
    extends java.util.LinkedHashMap<java.lang.String,​org.eclipse.lsp4j.jsonrpc.messages.Either3<java.lang.String,​java.lang.Number,​java.lang.Boolean>>
    Value-object describing what options formatting should use.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      FormattingOptions()  
      FormattingOptions​(int tabSize, boolean insertSpaces)  
      FormattingOptions​(int tabSize, boolean insertSpaces, java.util.Map<java.lang.String,​java.lang.String> properties)
      Deprecated.
      See https://github.com/eclipse-lsp4j/lsp4j/issues/99
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.Boolean getBoolean​(java.lang.String key)  
      java.lang.Number getNumber​(java.lang.String key)  
      java.util.Map<java.lang.String,​java.lang.String> getProperties()
      Deprecated.
      See https://github.com/eclipse-lsp4j/lsp4j/issues/99
      java.lang.String getString​(java.lang.String key)  
      int getTabSize()
      Size of a tab in spaces.
      boolean isInsertFinalNewline()
      Insert a newline character at the end of the file if one does not exist.
      boolean isInsertSpaces()
      Prefer spaces over tabs.
      boolean isTrimFinalNewlines()
      Trim all newlines after the final newline at the end of the file.
      boolean isTrimTrailingWhitespace()
      Trim trailing whitespace on a line.
      void putBoolean​(java.lang.String key, java.lang.Boolean value)  
      void putNumber​(java.lang.String key, java.lang.Number value)  
      void putString​(java.lang.String key, java.lang.String value)  
      void setInsertFinalNewline​(boolean insertFinalNewline)  
      void setInsertSpaces​(boolean insertSpaces)  
      void setProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
      Deprecated.
      See https://github.com/eclipse-lsp4j/lsp4j/issues/99
      void setTabSize​(int tabSize)  
      void setTrimFinalNewlines​(boolean trimFinalNewlines)  
      void setTrimTrailingWhitespace​(boolean trimTrailingWhitespace)  
      • Methods inherited from class java.util.LinkedHashMap

        clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
      • Methods inherited from class java.util.HashMap

        clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
    • Constructor Detail

      • FormattingOptions

        public FormattingOptions()
      • FormattingOptions

        public FormattingOptions​(int tabSize,
                                 boolean insertSpaces)
      • FormattingOptions

        @Deprecated
        public FormattingOptions​(int tabSize,
                                 boolean insertSpaces,
                                 java.util.Map<java.lang.String,​java.lang.String> properties)
        Deprecated.
        See https://github.com/eclipse-lsp4j/lsp4j/issues/99
    • Method Detail

      • getString

        public java.lang.String getString​(java.lang.String key)
      • putString

        public void putString​(java.lang.String key,
                              java.lang.String value)
      • getNumber

        public java.lang.Number getNumber​(java.lang.String key)
      • putNumber

        public void putNumber​(java.lang.String key,
                              java.lang.Number value)
      • getBoolean

        public java.lang.Boolean getBoolean​(java.lang.String key)
      • putBoolean

        public void putBoolean​(java.lang.String key,
                               java.lang.Boolean value)
      • getTabSize

        public int getTabSize()
        Size of a tab in spaces.
      • setTabSize

        public void setTabSize​(int tabSize)
      • isInsertSpaces

        public boolean isInsertSpaces()
        Prefer spaces over tabs.
      • setInsertSpaces

        public void setInsertSpaces​(boolean insertSpaces)
      • isTrimTrailingWhitespace

        public boolean isTrimTrailingWhitespace()
        Trim trailing whitespace on a line.

        Since 3.15.0

      • setTrimTrailingWhitespace

        public void setTrimTrailingWhitespace​(boolean trimTrailingWhitespace)
      • isInsertFinalNewline

        public boolean isInsertFinalNewline()
        Insert a newline character at the end of the file if one does not exist.

        Since 3.15.0

      • setInsertFinalNewline

        public void setInsertFinalNewline​(boolean insertFinalNewline)
      • isTrimFinalNewlines

        public boolean isTrimFinalNewlines()
        Trim all newlines after the final newline at the end of the file.

        Since 3.15.0

      • setTrimFinalNewlines

        public void setTrimFinalNewlines​(boolean trimFinalNewlines)
      • getProperties

        @Deprecated
        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Deprecated.
        See https://github.com/eclipse-lsp4j/lsp4j/issues/99
      • setProperties

        @Deprecated
        public void setProperties​(java.util.Map<java.lang.String,​java.lang.String> properties)
        Deprecated.
        See https://github.com/eclipse-lsp4j/lsp4j/issues/99