Package groovy.json
Interface JsonGenerator
- 
- All Known Implementing Classes:
- DefaultJsonGenerator
 
 public interface JsonGeneratorGenerates JSON from objects. TheJsonGenerator.Optionsbuilder can be used to configure an instance of a JsonGenerator.- Since:
- 2.5.0
- See Also:
- JsonGenerator.Options.build()
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceJsonGenerator.ConverterHandles converting a given type.static classJsonGenerator.OptionsA builder used to construct aJsonGeneratorinstance that allows control over the serialized JSON output.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisExcludingFieldsNamed(java.lang.String name)Indicates whether this JsonGenerator is configured to exclude fields by the given name.booleanisExcludingValues(java.lang.Object value)Indicates whether this JsonGenerator is configured to exclude values of the given object (may benull).java.lang.StringtoJson(java.lang.Object object)Converts an object to its JSON representation.
 
- 
- 
- 
Method Detail- 
toJsonjava.lang.String toJson(java.lang.Object object) Converts an object to its JSON representation.- Parameters:
- object- to convert to JSON
- Returns:
- JSON
 
 - 
isExcludingFieldsNamedboolean isExcludingFieldsNamed(java.lang.String name) Indicates whether this JsonGenerator is configured to exclude fields by the given name.- Parameters:
- name- of the field
- Returns:
- true if that field is being excluded, else false
 
 - 
isExcludingValuesboolean isExcludingValues(java.lang.Object value) Indicates whether this JsonGenerator is configured to exclude values of the given object (may benull).- Parameters:
- value- an instance of an object
- Returns:
- true if values like this are being excluded, else false
 
 
- 
 
-