public class SchemaMapper extends Object
Constructor and Description |
---|
SchemaMapper()
Create a schema mapper with the default
RuleFactory
implementation. |
SchemaMapper(RuleFactory ruleFactory,
SchemaGenerator schemaGenerator)
Create a schema mapper with the given
RuleFactory . |
Modifier and Type | Method and Description |
---|---|
com.sun.codemodel.JType |
generate(com.sun.codemodel.JCodeModel codeModel,
String className,
String packageName,
String json) |
com.sun.codemodel.JType |
generate(com.sun.codemodel.JCodeModel codeModel,
String className,
String packageName,
String json,
URI schemaLocation) |
com.sun.codemodel.JType |
generate(com.sun.codemodel.JCodeModel codeModel,
String className,
String packageName,
URL schemaUrl)
Reads a schema and adds generated types to the given code model.
|
public SchemaMapper(RuleFactory ruleFactory, SchemaGenerator schemaGenerator)
RuleFactory
.ruleFactory
- A factory used by this mapper to create Java type generation
rules.schemaGenerator
- the generator that this mapper will use if the config dictates
that the input documents are plain json (not json schema)public SchemaMapper()
RuleFactory
implementation.RuleFactory
public com.sun.codemodel.JType generate(com.sun.codemodel.JCodeModel codeModel, String className, String packageName, URL schemaUrl) throws IOException
codeModel
- the java code-generation context that should be used to
generated new typesclassName
- the name of the parent class the represented by this schemapackageName
- the target package that should be used for generated typesschemaUrl
- location of the schema to be used as inputIOException
- if the schema content cannot be readpublic com.sun.codemodel.JType generate(com.sun.codemodel.JCodeModel codeModel, String className, String packageName, String json, URI schemaLocation) throws IOException
IOException
public com.sun.codemodel.JType generate(com.sun.codemodel.JCodeModel codeModel, String className, String packageName, String json) throws IOException
IOException
Copyright © 2015. All rights reserved.