org.raml.v2.api.model.v10.datamodel.AnyTypeDeclaration Java Examples

The following examples show how to use org.raml.v2.api.model.v10.datamodel.AnyTypeDeclaration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UnionTypesHelper.java    From raml-java-tools with Apache License 2.0 6 votes vote down vote up
private static Map<Class<? extends TypeDeclaration>, Integer> getPriorityTypeMap() {
    return new ImmutableMap.Builder<Class<? extends TypeDeclaration>, Integer>()
        .put(NullTypeDeclaration.class, 1)
        .put(BooleanTypeDeclaration.class, 2)
        .put(IntegerTypeDeclaration.class, 3)
        .put(NumberTypeDeclaration.class, 4)
        .put(DateTypeDeclaration.class, 5)
        .put(TimeOnlyTypeDeclaration.class, 6)
        .put(DateTimeOnlyTypeDeclaration.class, 7)
        .put(DateTimeTypeDeclaration.class, 8)
        .put(StringTypeDeclaration.class, 9)
        .put(ObjectTypeDeclaration.class, 10)
        .put(ArrayTypeDeclaration.class, 11)
        .put(UnionTypeDeclaration.class, 12)
        .put(FileTypeDeclaration.class, 13)
        .put(AnyTypeDeclaration.class, 14)
        .build();
}
 
Example #2
Source File: AnyTypeInterpreter.java    From springmvc-raml-plugin with Apache License 2.0 6 votes vote down vote up
@Override
public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) {

	AnyTypeDeclaration anyTypeDeclaration = (AnyTypeDeclaration) type;

	RamlInterpretationResult result = new RamlInterpretationResult(type.required());
	String objectName;
	if ("array".equalsIgnoreCase(anyTypeDeclaration.type())) {
		objectName = Object.class.getSimpleName();
	} else {
		objectName = Void.class.getSimpleName();
	}

	result.setResolvedClass(CodeModelHelper.findFirstClassBySimpleName(builderModel, objectName));
	return result;
}
 
Example #3
Source File: AnyTypeInterpreter.java    From springmvc-raml-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public Set<Class<? extends TypeDeclaration>> getSupportedTypes() {
	if (set == null) {
		set = new LinkedHashSet<>(1);
		set.add(AnyTypeDeclaration.class);
	}
	return set;
}