@Override public <T extends Annotation> Optional<T> getAnnotation(Class<T> annotationType) { return type.getAnnotation(annotationType); }
public void write(AnnotationInstanceEmitter emitter, IndentedAppendable writer) throws IOException { Class c = (Class) type.getType(); writer.appendLine(c.getSimpleName() + ":"); writer.indent(); if (superTypes != null && superTypes.size() > 0) { writer.appendList("type", Collections2.transform(superTypes, new Function<RamlType, String>() { @Override public String apply(RamlType input) { return input.getTypeName(); } }).toArray(new String[] {})); } emitter.emit(this); writeExample(writer); if (type.getDescription().isPresent()) { writer.appendLine("description: " + type.getDescription().get()); } writer.appendLine("properties:"); writer.indent(); for (RamlProperty ramlProperty : properties.values()) { ramlProperty.write(emitter, writer); } writer.outdent(); writer.outdent(); }
public boolean isRamlScalarType() { Optional<ScalarType> st = ScalarType.fromType(type.getType()); return st.isPresent(); }
public String getTypeName() { Optional<ScalarType> st = ScalarType.fromType(type.getType()); if (st.isPresent()) { if (collection == true) { return st.get().getRamlSyntax() + "[]"; } else { return st.get().getRamlSyntax(); } } else { Class c = (Class) type.getType(); if (collection == true) { return c.getSimpleName() + "[]"; } else { return c.getSimpleName(); } } }