public class RuleFactory extends Object
| Constructor and Description |
|---|
RuleFactory()
Create a rule factory with the default generation config options.
|
RuleFactory(GenerationConfig generationConfig,
Annotator annotator,
SchemaStore schemaStore)
Create a new rule factory with the given generation config options.
|
| Modifier and Type | Method and Description |
|---|---|
Rule<com.sun.codemodel.JDefinedClass,com.sun.codemodel.JDefinedClass> |
getAdditionalPropertiesRule()
Provides a rule instance that should be applied when an
"additionalProperties" declaration is found in the schema.
|
Annotator |
getAnnotator()
Gets the annotator that will in apply annotations to the generated code
to allow correct serialization and deserialization, according to the
chosen annotation style.
|
Rule<com.sun.codemodel.JPackage,com.sun.codemodel.JClass> |
getArrayRule()
Provides a rule instance that should be applied when an "array"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> |
getDefaultRule()
Provides a rule instance that should be applied when a property
declaration is found in the schema to assign any appropriate default
value to that property.
|
Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment> |
getDescriptionRule()
Provides a rule instance that should be applied when a "description"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType> |
getEnumRule()
Provides a rule instance that should be applied when an "enum"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JType,com.sun.codemodel.JType> |
getFormatRule()
Provides a rule instance that should be applied when a "format"
declaration is found in the schema.
|
GenerationConfig |
getGenerationConfig()
Gets the configuration options that will influence the java code
generated by rules created by this factory.
|
Rule<com.sun.codemodel.JType,com.sun.codemodel.JType> |
getMediaRule()
Provides a rule instance that should be applied when a "media"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> |
getMinimumMaximumRule()
Provides a rule instance that should be applied when a property
declaration is found in the schema, to assign any minimum/maximum
validation on that property
|
Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> |
getMinItemsMaxItemsRule()
Provides a rule instance that should be applied when a property
declaration is found in the schema, to assign any size validation
(minItems/maxItems) on that property
|
Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> |
getMinLengthMaxLengthRule()
Provides a rule instance that should be applied when a property
declaration is found in the schema, to assign any size validation
(minLength/maxLength) on that property
|
NameHelper |
getNameHelper()
Gets the name helper that is used to generate normalized Class and field
names.
|
Rule<com.sun.codemodel.JPackage,com.sun.codemodel.JType> |
getObjectRule()
Provides a rule instance that should be applied when an "object"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> |
getPatternRule()
Provides a rule instance that should be applied when a "pattern"
declaration is found in the schema for a property.
|
Rule<com.sun.codemodel.JDefinedClass,com.sun.codemodel.JDefinedClass> |
getPropertiesRule()
Provides a rule instance that should be applied when a "properties"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JDefinedClass,com.sun.codemodel.JDefinedClass> |
getPropertyRule()
Provides a rule instance that should be applied when a property
declaration (child of the "properties" declaration) is found in the
schema.
|
Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment> |
getRequiredRule()
Provides a rule instance that should be applied when a "required"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType> |
getSchemaRule()
Provides a rule instance that should be applied when a schema declaration
is found in the schema.
|
SchemaStore |
getSchemaStore()
Gets the store that finds and saves JSON schemas
|
Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment> |
getTitleRule()
Provides a rule instance that should be applied when a "title"
declaration is found in the schema.
|
Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType> |
getTypeRule()
Provides a rule instance that should be applied to a node to find its
equivalent Java type.
|
Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> |
getValidRule()
Provides a rule instance that should be applied when a property
declaration is found in the schema which itself contains properties, to
assign validation of the properties within that property
|
void |
setAnnotator(Annotator annotator)
The annotator used to mark up Java types with any annotations
that are required to build JSON compatible types
|
void |
setGenerationConfig(GenerationConfig generationConfig)
The generation config options for type generation.
|
void |
setSchemaStore(SchemaStore schemaStore)
The object used by this factory to get and store schemas
|
public RuleFactory(GenerationConfig generationConfig, Annotator annotator, SchemaStore schemaStore)
generationConfig - The generation config options for type generation. These
config options will influence the java code generated by rules
created by this factory.annotator - the annotator used to mark up Java types with any annotations
that are required to build JSON compatible typesschemaStore - the object used by this factory to get and store schemaspublic RuleFactory()
DefaultGenerationConfigpublic Rule<com.sun.codemodel.JPackage,com.sun.codemodel.JClass> getArrayRule()
public Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment> getDescriptionRule()
public Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType> getEnumRule()
public Rule<com.sun.codemodel.JType,com.sun.codemodel.JType> getFormatRule()
public Rule<com.sun.codemodel.JPackage,com.sun.codemodel.JType> getObjectRule()
public Rule<com.sun.codemodel.JDefinedClass,com.sun.codemodel.JDefinedClass> getPropertiesRule()
public Rule<com.sun.codemodel.JDefinedClass,com.sun.codemodel.JDefinedClass> getPropertyRule()
public Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment> getRequiredRule()
public Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType> getTypeRule()
public Rule<com.sun.codemodel.JDefinedClass,com.sun.codemodel.JDefinedClass> getAdditionalPropertiesRule()
public Rule<com.sun.codemodel.JDocCommentable,com.sun.codemodel.JDocComment> getTitleRule()
public Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType> getSchemaRule()
public Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> getDefaultRule()
public Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> getMinimumMaximumRule()
public Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> getMinItemsMaxItemsRule()
public Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> getMinLengthMaxLengthRule()
public Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> getPatternRule()
public Rule<com.sun.codemodel.JFieldVar,com.sun.codemodel.JFieldVar> getValidRule()
public GenerationConfig getGenerationConfig()
public void setGenerationConfig(GenerationConfig generationConfig)
generationConfig - Generation configpublic Annotator getAnnotator()
public void setAnnotator(Annotator annotator)
annotator - the annotatorpublic SchemaStore getSchemaStore()
public void setSchemaStore(SchemaStore schemaStore)
schemaStore - schema storepublic NameHelper getNameHelper()
public Rule<com.sun.codemodel.JType,com.sun.codemodel.JType> getMediaRule()
Copyright © 2014. All Rights Reserved.