Package org.apache.avro
Class Schema.Parser
java.lang.Object
org.apache.avro.Schema.Parser
- Enclosing class:
Schema
A parser for JSON-format schemas. Each named schema parsed with a parser is
added to the names known to the parser so that subsequently parsed schemas
may refer to it by name.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds the provided types to the set of defined, named types known to this parser.Deprecated.use addTypes(Iterabletypes) getTypes()
Returns the set of defined, named types known to this parser.boolean
True iff default values are validated.Parse a schema from the provided file.parse
(InputStream in) Parse a schema from the provided stream.Parse a schema from the provided string.Read a schema from one or more json stringssetValidateDefaults
(boolean validateDefaults) Enable or disable default value validation.
-
Constructor Details
-
Parser
public Parser() -
Parser
-
Parser
-
-
Method Details
-
addTypes
Deprecated.use addTypes(Iterabletypes) Adds the provided types to the set of defined, named types known to this parser. -
addTypes
Adds the provided types to the set of defined, named types known to this parser. -
getTypes
Returns the set of defined, named types known to this parser. -
setValidateDefaults
Enable or disable default value validation. -
getValidateDefaults
public boolean getValidateDefaults()True iff default values are validated. False by default. -
parse
Parse a schema from the provided file. If named, the schema is added to the names known to this parser.- Throws:
IOException
-
parse
Parse a schema from the provided stream. If named, the schema is added to the names known to this parser. The input stream stays open after the parsing.- Throws:
IOException
-
parse
Read a schema from one or more json strings -
parse
Parse a schema from the provided string. If named, the schema is added to the names known to this parser. -
parseInternal
-