/** * The simple name for client-side code generation. * * @return The simple name for client-side code generation. */ public String getClientSimpleName() { String clientSimpleName = getSimpleName().toString(); ClientName clientName = getAnnotation(ClientName.class); if (clientName != null) { clientSimpleName = clientName.value(); } return clientSimpleName; }
/** * The simple name for client-side code generation. * * @return The simple name for client-side code generation. */ public String getClientSimpleName() { String clientSimpleName = getSimpleName().toString(); ClientName clientName = getAnnotation(ClientName.class); if (clientName != null) { clientSimpleName = clientName.value(); } return clientSimpleName; }
@Override public String getLabel() { String label = this.typeDefinition.getSimpleName().toString(); JsonRootName rootName = this.typeDefinition.getAnnotation(JsonRootName.class); label = rootName == null ? label : rootName.value(); JavaDoc.JavaDocTagList tags = this.typeDefinition.getJavaDoc().get("label"); if (tags != null && tags.size() > 0) { String tag = tags.get(0).trim(); label = tag.isEmpty() ? label : tag; } Label labelInfo = this.typeDefinition.getAnnotation(Label.class); label = labelInfo == null ? label : labelInfo.value(); return label; }
@Override public String getLabel() { String label = this.typeDefinition.getSimpleName().toString(); JsonRootName rootName = this.typeDefinition.getAnnotation(JsonRootName.class); label = rootName == null ? label : rootName.value(); JavaDoc.JavaDocTagList tags = this.typeDefinition.getJavaDoc().get("label"); if (tags != null && tags.size() > 0) { String tag = tags.get(0).trim(); label = tag.isEmpty() ? label : tag; } Label labelInfo = this.typeDefinition.getAnnotation(Label.class); label = labelInfo == null ? label : labelInfo.value(); return label; }
public String getTypeIdValue() { List<JsonSubTypes> subTypes = AnnotationUtils.getAnnotations(JsonSubTypes.class, this); if (!subTypes.isEmpty()) { final Types typeUtils = env.getTypeUtils(); for (JsonSubTypes.Type type : subTypes.get(0).value()) { DecoratedTypeMirror decoratedType = Annotations.mirrorOf(type::value, env); if (typeUtils.isSameType(asType(), decoratedType.getDelegate())) { if (!type.name().isEmpty()) { return type.name(); } } } } JsonTypeName typeName = getAnnotation(JsonTypeName.class); if (typeName != null && !typeName.value().isEmpty()) { return typeName.value(); } return isAbstract() ? "..." : getSimpleName().toString(); }
public String getTypeIdValue() { List<JsonSubTypes> subTypes = AnnotationUtils.getAnnotations(JsonSubTypes.class, this); if (!subTypes.isEmpty()) { final Types typeUtils = env.getTypeUtils(); for (JsonSubTypes.Type type : subTypes.get(0).value()) { DecoratedTypeMirror decoratedType = Annotations.mirrorOf(type::value, env); if (typeUtils.isSameType(asType(), decoratedType.getDelegate())) { if (!type.name().isEmpty()) { return type.name(); } } } } JsonTypeName typeName = getAnnotation(JsonTypeName.class); if (typeName != null && !typeName.value().isEmpty()) { return typeName.value(); } return isAbstract() ? "..." : getSimpleName().toString(); }