Package org.apache.juneau.httppart
Class HttpPartSchema
java.lang.Object
org.apache.juneau.httppart.HttpPartSchema
Represents an OpenAPI schema definition.
 
 The schema definition can be applied to any HTTP parts such as bodies, headers, query/form parameters, and URL path parts.
 
The API is generic enough to apply to any path part although some attributes may only applicable for certain parts.
 
 Schema objects are created via builders instantiated through the create() method.
 
Notes:
- This class is thread safe and reusable.
See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final HttpPartSchemaReusable instance of this object, all default settings.static final HttpPartSchemaArray typestatic final HttpPartSchemaComma-delimited array typestatic final HttpPartSchemaMulti-part array typestatic final HttpPartSchemaPipe-delimited array typestatic final HttpPartSchemaSpace-delimited array typestatic final HttpPartSchemaTab-delimited array typestatic final HttpPartSchemaUON-formatted array typestatic final HttpPartSchemaBinary typestatic final HttpPartSchemaSpaced binary typestatic final HttpPartSchemaBoolean typestatic final HttpPartSchemaByte typestatic final HttpPartSchemaDate typestatic final HttpPartSchemaDate-time typestatic final HttpPartSchemaDouble typestatic final HttpPartSchemaFile typestatic final HttpPartSchemaFloat typestatic final HttpPartSchemaInt32 typestatic final HttpPartSchemaInt64 typestatic final HttpPartSchemaInteger typestatic final HttpPartSchemaNo typestatic final HttpPartSchemaNumber typestatic final HttpPartSchemaObject typestatic final HttpPartSchemaComma-delimited object typestatic final HttpPartSchemaPipe-delimited object typestatic final HttpPartSchemaSpace-delimited object typestatic final HttpPartSchemaTab-delimited object typestatic final HttpPartSchemaUON-formated object typestatic final HttpPartSchemaString typestatic final HttpPartSchemaUON-formated simple type
- 
Method SummaryModifier and TypeMethodDescriptionstatic HttpPartSchema.Buildercreate()Instantiates a new builder for this object.static HttpPartSchemacreate(Annotation a) Finds the schema information on the specified annotation.static HttpPartSchemacreate(Annotation a, String defaultName) Finds the schema information on the specified annotation.static HttpPartSchemacreate(Class<? extends Annotation> c, Method m) Finds the schema information for the specified method return.static HttpPartSchemacreate(Class<? extends Annotation> c, Type t) Finds the schema information for the specified class.static HttpPartSchemacreate(Class<? extends Annotation> c, ParamInfo mpi) Finds the schema information for the specified method parameter.static HttpPartSchema.BuilderShortcut for callingcreate().type(type); static HttpPartSchema.BuilderShortcut for callingcreate().type(type).format(format); Returns thecollectionFormat field of this schema.Returns thedefault field of this schema.getEnum()Returns theenum field of this schema.Returns theformat field of this schema.Returns theformat field of this schema.getItems()Returns themaximum field of this schema.Returns themaximum field of this schema.Returns thexxx field of this schema.Returns thexxx field of this schema.Returns thexxx field of this schema.Returns theminimum field of this schema.Returns thexxx field of this schema.Returns thexxx field of this schema.Returns thexxx field of this schema.Returns thexxx field of this schema.getName()Returns the name of the object described by this schema, for example the query or form parameter name.ClassMeta<?>Returns the default parsed type for this schema.Class<? extends HttpPartParser>Returns theparser field of this schema.Returns thexxx field of this schema.getProperty(String name) Returns the schema information for the specified property.Class<? extends HttpPartSerializer>Returns theserializer field of this schema.getType()Returns thetype field of this schema.Returns thetype field of this schema.booleanReturnstrue if this schema has properties associated with it.booleanReturns theallowEmptyValue field of this schema.booleanReturns theexclusiveMaximum field of this schema.booleanReturns theexclusiveMinimum field of this schema.booleanReturns therequired field of this schema.booleanReturns theskipIfEmpty field of this schema.booleanReturns theuniqueItems field of this schema.static HttpPartSchema.BuildertArray()Shortcut forcreate ().type(HttpPartDataType.ARRAY )static HttpPartSchema.BuildertArray(HttpPartSchema.Builder items) Shortcut forcreate ().type(HttpPartDataType.ARRAY ).items(items)static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.CSV )static HttpPartSchema.BuildertArrayCsv(HttpPartSchema.Builder items) Shortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.CSV ).items(items)static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.MULTI )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.MULTI ).items(items)static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.PIPES )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.PIPES ).items(items)static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.SSV )static HttpPartSchema.BuildertArraySsv(HttpPartSchema.Builder items) Shortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.SSV ).items(items)static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.TSV )static HttpPartSchema.BuildertArrayTsv(HttpPartSchema.Builder items) Shortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.TSV ).items(items)static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.UONC )static HttpPartSchema.BuildertArrayUon(HttpPartSchema.Builder items) Shortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.UONC ).items(items)static HttpPartSchema.BuildertBinary()Shortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.BINARY )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.BINARY_SPACED )static HttpPartSchema.BuildertBoolean()Shortcut forcreate ().type(HttpPartDataType.BOOLEAN )static HttpPartSchema.BuildertByte()Shortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.BYTE )static HttpPartSchema.BuildertDate()Shortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.DATE )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.DATE_TIME )static HttpPartSchema.BuildertDouble()Shortcut forcreate ().type(HttpPartDataType.NUMBER ).format(HttpPartFormat.DOUBLE )static HttpPartSchema.BuildertFile()Shortcut forcreate ().type(HttpPartDataType.FILE )static HttpPartSchema.BuildertFloat()Shortcut forcreate ().type(HttpPartDataType.NUMBER ).format(HttpPartFormat.FLOAT )static HttpPartSchema.BuildertInt32()Shortcut forcreate ().type(HttpPartDataType.INTEGER ).format(HttpPartFormat.INT32 )static HttpPartSchema.BuildertInt64()Shortcut forcreate ().type(HttpPartDataType.INTEGER ).format(HttpPartFormat.INT64 )static HttpPartSchema.BuildertInteger()Shortcut forcreate ().type(HttpPartDataType.INTEGER )static HttpPartSchema.BuildertNone()Shortcut forcreate ().type(HttpPartDataType.NONE )static HttpPartSchema.BuildertNumber()Shortcut forcreate ().type(HttpPartDataType.NUMBER )static HttpPartSchema.BuildertObject()Shortcut forcreate ().type(HttpPartDataType.OBJECT )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.CSV )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.PIPES )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.SSV )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.TSV )static HttpPartSchema.BuilderShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.UON )toString()static HttpPartSchema.BuildertString()Shortcut forcreate ().type(HttpPartDataType.STRING )static HttpPartSchema.BuildertUon()Shortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.UON )validateInput(String in) Throws aParseExceptionif the specified pre-parsed input does not validate against this schema.<T> TvalidateOutput(T o, BeanContext bc) Throws aParseExceptionif the specified parsed output does not validate against this schema.
- 
Field Details- 
DEFAULTReusable instance of this object, all default settings.
- 
T_BOOLEANBoolean type
- 
T_FILEFile type
- 
T_INTEGERInteger type
- 
T_INT32Int32 type
- 
T_INT64Int64 type
- 
T_NONENo type
- 
T_NUMBERNumber type
- 
T_FLOATFloat type
- 
T_DOUBLEDouble type
- 
T_STRINGString type
- 
T_BYTEByte type
- 
T_BINARYBinary type
- 
T_BINARY_SPACEDSpaced binary type
- 
T_DATEDate type
- 
T_DATETIMEDate-time type
- 
T_UONUON-formated simple type
- 
T_ARRAYArray type
- 
T_ARRAY_CSVComma-delimited array type
- 
T_ARRAY_PIPESPipe-delimited array type
- 
T_ARRAY_SSVSpace-delimited array type
- 
T_ARRAY_TSVTab-delimited array type
- 
T_ARRAY_UONUON-formatted array type
- 
T_ARRAY_MULTIMulti-part array type
- 
T_OBJECTObject type
- 
T_OBJECT_CSVComma-delimited object type
- 
T_OBJECT_PIPESPipe-delimited object type
- 
T_OBJECT_SSVSpace-delimited object type
- 
T_OBJECT_TSVTab-delimited object type
- 
T_OBJECT_UONUON-formated object type
 
- 
- 
Method Details- 
createInstantiates a new builder for this object.- Returns:
- A new builder for this object.
 
- 
tBooleanShortcut forcreate ().type(HttpPartDataType.BOOLEAN )- Returns:
- A new builder for this object.
 
- 
tFileShortcut forcreate ().type(HttpPartDataType.FILE )- Returns:
- A new builder for this object.
 
- 
tIntegerShortcut forcreate ().type(HttpPartDataType.INTEGER )- Returns:
- A new builder for this object.
 
- 
tInt32Shortcut forcreate ().type(HttpPartDataType.INTEGER ).format(HttpPartFormat.INT32 )- Returns:
- A new builder for this object.
 
- 
tInt64Shortcut forcreate ().type(HttpPartDataType.INTEGER ).format(HttpPartFormat.INT64 )- Returns:
- A new builder for this object.
 
- 
tNoneShortcut forcreate ().type(HttpPartDataType.NONE )- Returns:
- A new builder for this object.
 
- 
tNumberShortcut forcreate ().type(HttpPartDataType.NUMBER )- Returns:
- A new builder for this object.
 
- 
tFloatShortcut forcreate ().type(HttpPartDataType.NUMBER ).format(HttpPartFormat.FLOAT )- Returns:
- A new builder for this object.
 
- 
tDoubleShortcut forcreate ().type(HttpPartDataType.NUMBER ).format(HttpPartFormat.DOUBLE )- Returns:
- A new builder for this object.
 
- 
tStringShortcut forcreate ().type(HttpPartDataType.STRING )- Returns:
- A new builder for this object.
 
- 
tByteShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.BYTE )- Returns:
- A new builder for this object.
 
- 
tBinaryShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.BINARY )- Returns:
- A new builder for this object.
 
- 
tBinarySpacedShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.BINARY_SPACED )- Returns:
- A new builder for this object.
 
- 
tDateShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.DATE )- Returns:
- A new builder for this object.
 
- 
tDateTimeShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.DATE_TIME )- Returns:
- A new builder for this object.
 
- 
tUonShortcut forcreate ().type(HttpPartDataType.STRING ).format(HttpPartFormat.UON )- Returns:
- A new builder for this object.
 
- 
tArrayShortcut forcreate ().type(HttpPartDataType.ARRAY )- Returns:
- A new builder for this object.
 
- 
tArrayShortcut forcreate ().type(HttpPartDataType.ARRAY ).items(items)- Parameters:
- items- The schema of the array items.
- Returns:
- A new builder for this object.
 
- 
tArrayCsvShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.CSV )- Returns:
- A new builder for this object.
 
- 
tArrayCsvShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.CSV ).items(items)- Parameters:
- items- The schema of the array items.
- Returns:
- A new builder for this object.
 
- 
tArrayPipesShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.PIPES )- Returns:
- A new builder for this object.
 
- 
tArrayPipesShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.PIPES ).items(items)- Parameters:
- items- The schema of the array items.
- Returns:
- A new builder for this object.
 
- 
tArraySsvShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.SSV )- Returns:
- A new builder for this object.
 
- 
tArraySsvShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.SSV ).items(items)- Parameters:
- items- The schema of the array items.
- Returns:
- A new builder for this object.
 
- 
tArrayTsvShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.TSV )- Returns:
- A new builder for this object.
 
- 
tArrayTsvShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.TSV ).items(items)- Parameters:
- items- The schema of the array items.
- Returns:
- A new builder for this object.
 
- 
tArrayUonShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.UONC )- Returns:
- A new builder for this object.
 
- 
tArrayUonShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.UONC ).items(items)- Parameters:
- items- The schema of the array items.
- Returns:
- A new builder for this object.
 
- 
tArrayMultiShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.MULTI )- Returns:
- A new builder for this object.
 
- 
tArrayMultiShortcut forcreate ().type(HttpPartDataType.ARRAY ).collectionFormat(HttpPartCollectionFormat.MULTI ).items(items)- Parameters:
- items- The schema of the array items.
- Returns:
- A new builder for this object.
 
- 
tObjectShortcut forcreate ().type(HttpPartDataType.OBJECT )- Returns:
- A new builder for this object.
 
- 
tObjectCsvShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.CSV )- Returns:
- A new builder for this object.
 
- 
tObjectPipesShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.PIPES )- Returns:
- A new builder for this object.
 
- 
tObjectSsvShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.SSV )- Returns:
- A new builder for this object.
 
- 
tObjectTsvShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.TSV )- Returns:
- A new builder for this object.
 
- 
tObjectUonShortcut forcreate ().type(HttpPartDataType.OBJECT ).collectionFormat(HttpPartCollectionFormat.UON )- Returns:
- A new builder for this object.
 
- 
createFinds the schema information for the specified method parameter.This method will gather all the schema information from the annotations at the following locations: - The method parameter.
- The method parameter class.
- The method parameter parent classes and interfaces.
 
- 
createFinds the schema information for the specified method return.This method will gather all the schema information from the annotations at the following locations: - The method.
- The method return class.
- The method return parent classes and interfaces.
 
- 
createFinds the schema information for the specified class.This method will gather all the schema information from the annotations on the class and all parent classes/interfaces. 
- 
createShortcut for callingcreate().type(type); - Parameters:
- type- The schema type value.
- Returns:
- A new builder.
 
- 
createShortcut for callingcreate().type(type).format(format); - Parameters:
- type- The schema type value.
- format- The schema format value.
- Returns:
- A new builder.
 
- 
createFinds the schema information on the specified annotation.- Parameters:
- a- The annotation to find the schema information on..
- Returns:
- The schema information found on the annotation.
 
- 
createFinds the schema information on the specified annotation.- Parameters:
- a- The annotation to find the schema information on..
- defaultName- The default part name if not specified on the annotation.
- Returns:
- The schema information found on the annotation.
 
- 
getParsedTypeReturns the default parsed type for this schema.- Returns:
- The default parsed type for this schema.  Never null .
 
- 
getNameReturns the name of the object described by this schema, for example the query or form parameter name.- Returns:
- The name, or null if not specified.
- See Also:
 
- 
getTypeReturns thetype field of this schema.- Returns:
- The type field of this schema, ornull if not specified.
- See Also:
 
- 
getTypeReturns thetype field of this schema.- Parameters:
- cm- The class meta of the object.
 Used to auto-detect the type if the type was not specified.
- Returns:
- The format field of this schema, or null if not specified.
- See Also:
 
- 
getDefaultReturns thedefault field of this schema.- Returns:
- The default value for this schema, or null if not specified.
- See Also:
 
- 
getCollectionFormatReturns thecollectionFormat field of this schema.- Returns:
- The collectionFormat field of this schema, ornull if not specified.
- See Also:
 
- 
getFormatReturns theformat field of this schema.- Returns:
- The format field of this schema, ornull if not specified.
- See Also:
 
- 
getFormatReturns theformat field of this schema.- Parameters:
- cm- The class meta of the object.
 Used to auto-detect the format if the format was not specified.
- Returns:
- The format field of this schema, ornull if not specified.
- See Also:
 
- 
getItemsReturns themaximum field of this schema.- Returns:
- The schema for child items of the object represented by this schema, or null if not defined.
- See Also:
 
- 
getMaximumReturns themaximum field of this schema.- Returns:
- The maximum field of this schema, ornull if not specified.
- See Also:
 
- 
getMinimumReturns theminimum field of this schema.- Returns:
- The minimum field of this schema, ornull if not specified.
- See Also:
 
- 
getMultipleOfReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
getPatternReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
getMaxLengthReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
getMinLengthReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
getMaxItemsReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
getMinItemsReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
getMaxPropertiesReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
getMinPropertiesReturns thexxx field of this schema.- Returns:
- The xxx field of this schema, ornull if not specified.
- See Also:
 
- 
isExclusiveMaximumReturns theexclusiveMaximum field of this schema.- Returns:
- The exclusiveMaximum field of this schema.
- See Also:
 
- 
isExclusiveMinimumReturns theexclusiveMinimum field of this schema.- Returns:
- The exclusiveMinimum field of this schema.
- See Also:
 
- 
isUniqueItemsReturns theuniqueItems field of this schema.- Returns:
- The uniqueItems field of this schema.
- See Also:
 
- 
isRequiredReturns therequired field of this schema.- Returns:
- The required field of this schema.
- See Also:
 
- 
isSkipIfEmptyReturns theskipIfEmpty field of this schema.- Returns:
- The skipIfEmpty field of this schema.
- See Also:
 
- 
isAllowEmptyValueReturns theallowEmptyValue field of this schema.- Returns:
- The skipIfEmpty field of this schema.
- See Also:
 
- 
getEnumReturns theenum field of this schema.- Returns:
- The enum field of this schema, ornull if not specified.
- See Also:
 
- 
getParserReturns theparser field of this schema.- Returns:
- The parser field of this schema, ornull if not specified.
- See Also:
 
- 
getSerializerReturns theserializer field of this schema.- Returns:
- The serializer field of this schema, ornull if not specified.
- See Also:
 
- 
validateInputThrows aParseExceptionif the specified pre-parsed input does not validate against this schema.- Parameters:
- in- The input.
- Returns:
- The same object passed in.
- Throws:
- SchemaValidationException- if the specified pre-parsed input does not validate against this schema.
 
- 
validateOutputThrows aParseExceptionif the specified parsed output does not validate against this schema.- Type Parameters:
- T- The return type.
- Parameters:
- o- The parsed output.
- bc- The bean context used to detect POJO types.
- Returns:
- The same object passed in.
- Throws:
- SchemaValidationException- if the specified parsed output does not validate against this schema.
 
- 
getPropertyReturns the schema information for the specified property.- Parameters:
- name- The property name.
- Returns:
- The schema information for the specified property, or null if properties are not defined on this schema.
 
- 
hasPropertiesReturnstrue if this schema has properties associated with it.- Returns:
- true if this schema has properties associated with it.
 
- 
toString
 
-