Package dk.mada.jaxrs.openapi
Class ParserTypes
java.lang.Object
dk.mada.jaxrs.openapi.ParserTypes
Types found while parsing.
This is only used to collect the types. When parsing is completed, they will be moved to the model's Types container
after being resolved and mapped.
-
Constructor Summary
ConstructorDescriptionParserTypes
(TypeNames typeNames, ParserOpts parserOpts, Parser.LeakedGeneratorOpts leakedGenOpts) Create new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Registers a new DTO.void
Collection types such as ListDto are changed toList<Dto>
.Find a type from a type name.Get a type from a type name.Returns the defined DTOs.Returns all the interfaces.Returns the interfaces implemented by a given type name.getOrMakeInterface
(TypeName tn, List<ParserTypeRef> anyOfRefs) Get or make a new interface type.info()
Returns information about the model.Remaps a DTO to a new type.
-
Constructor Details
-
ParserTypes
public ParserTypes(TypeNames typeNames, ParserOpts parserOpts, Parser.LeakedGeneratorOpts leakedGenOpts) Create new instance.- Parameters:
typeNames
- the type names instanceparserOpts
- the parser optionsleakedGenOpts
- the leaked generator options
-
-
Method Details
-
getOrMakeInterface
Get or make a new interface type.- Parameters:
tn
- the type name of the interfaceanyOfRefs
- the types referenced by the interface- Returns:
- an existing or new interface type
-
getInterfaces
Returns all the interfaces.- Returns:
- all the interfaces
-
getInterfacesImplementedBy
Returns the interfaces implemented by a given type name.- Parameters:
tn
- the type name to look for.- Returns:
- the interfaces implemented by a given type name
-
addDto
Registers a new DTO.- Parameters:
dto
- the DTO to register.
-
getActiveDtos
Returns the defined DTOs.- Returns:
- the defined DTOs
-
get
Get a type from a type name.- Parameters:
tn
- the type name to get- Returns:
- the associated type
- Throws:
IllegalArgumentException
- if there is no type associated with the given type name
-
find
Find a type from a type name.- Parameters:
tn
- the type name to get- Returns:
- the associated type, or empty
-
consolidateContainerDtos
public void consolidateContainerDtos()Collection types such as ListDto are changed toList<Dto>
. -
remapDto
Remaps a DTO to a new type. The target type gets stripped from empty validation references.- Parameters:
openapiName
- the DTOs OpenApi namenewType
- the type to remap the DTO to- Returns:
- the actual type remapped to (may have fewer validation references)
-
info
Returns information about the model.- Returns:
- information about the model
-