Package org.eclipse.xtext.resource
Class SaveOptions
- java.lang.Object
-
- org.eclipse.xtext.resource.SaveOptions
-
public class SaveOptions extends java.lang.ObjectImmutable SaveOptions can be used to read and write options into the map that is passed intoResource.save(Map). Clients should create options by means ofSaveOptions.newBuilder()and subsequent calls to configure the result orSaveOptions.defaultOptions(). The options map may be populated viatoOptionsMap()oraddTo(Map). Clients are free to extend this interface and the respective builder implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSaveOptions.BuilderAllows to create newSaveOptionsin a readable manner.
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringKEY
-
Constructor Summary
Constructors Modifier Constructor Description protectedSaveOptions(boolean formatting, boolean validating)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddTo(java.util.Map<java.lang.Object,java.lang.Object> saveOptions)Configures the save options into the given map.static SaveOptionsdefaultOptions()This is equal tobuilder().getOptions().booleanequals(java.lang.Object obj)static SaveOptionsgetOptions(java.util.Map<?,?> saveOptions)Transparently handles the deprecated options that could be passed as map-entries toResource.save(Map)and converts them to semantically equalSaveOptions.inthashCode()booleanisFormatting()booleanisValidating()Deprecated.static SaveOptions.BuildernewBuilder()java.util.Map<java.lang.Object,java.lang.Object>toOptionsMap()java.lang.StringtoString()
-
-
-
Method Detail
-
getOptions
public static SaveOptions getOptions(java.util.Map<?,?> saveOptions)
Transparently handles the deprecated options that could be passed as map-entries toResource.save(Map)and converts them to semantically equalSaveOptions.- Parameters:
saveOptions- the options-map ornullif none.- Returns:
- the options to use. Will never return
null.
-
addTo
public void addTo(java.util.Map<java.lang.Object,java.lang.Object> saveOptions)
Configures the save options into the given map. The method modifies the given parameter so it may not be an ImmutableMap or a read-only Map.- Parameters:
saveOptions- the options to be modified. May not benull.
-
toOptionsMap
public java.util.Map<java.lang.Object,java.lang.Object> toOptionsMap()
-
isFormatting
public boolean isFormatting()
-
isValidating
@Deprecated public boolean isValidating()
Deprecated.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
newBuilder
public static SaveOptions.Builder newBuilder()
-
defaultOptions
public static SaveOptions defaultOptions()
This is equal tobuilder().getOptions().
-
-