@Override public boolean required() { return type.required(); }
/** * Safely get required from a type with null checks * * @param type * The RAML TypeDeclaration to check * @return true if this parameter is required, false if optional */ public static boolean isRequired(TypeDeclaration type) { if (type == null || type.required() == null) { return true; } else { return type.required(); } }
@Override public TypeName typeName(ReferencePluginContext referencePluginContext, TypeDeclaration ramlType, TypeName currentSuggestion) { if (! ramlType.required()) { return currentSuggestion.box(); } else { return currentSuggestion; } } }
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); result.setResolvedClass(CodeModelHelper.findFirstClassBySimpleName(builderModel, Object.class.getSimpleName())); return result; } }
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); result.setResolvedClass(CodeModelHelper.findFirstClassBySimpleName(builderModel, Boolean.class.getSimpleName())); return result; }
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); result.setResolvedClass(CodeModelHelper.findFirstClassBySimpleName(builderModel, Void.class.getSimpleName())); return result; }
@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; } }
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); result.setResolvedClass(builderModel.ref(SchemaHelper.mapDateFormat(type.type()))); return result; } }
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); String resolvedType = String.class.getSimpleName(); typeCheck(type);
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required());
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required());
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); typeCheck(type);
debug("Param Data type " + x.type()); debug("Param Is Required " + x.required()); });
@Override public RamlInterpretationResult interpret(RamlRoot document, TypeDeclaration type, JCodeModel builderModel, boolean property) { RamlInterpretationResult result = new RamlInterpretationResult(type.required()); typeCheck(type);