@Override public String getSlug() { return "json_" + this.typeDefinition.getContext().getSlug(this.typeDefinition); }
@Override public Namespace getNamespace() { return new SyntaxImpl(this.typeDefinition.getContext(), this.registrationContext); }
@Override public Syntax getSyntax() { return new SyntaxImpl(this.typeDefinition.getContext(), this.registrationContext); }
@Override public String getSlug() { return "json_" + this.typeDefinition.getContext().getSlug(this.typeDefinition); }
@Override public Namespace getNamespace() { return new SyntaxImpl(this.typeDefinition.getContext(), this.registrationContext); }
@Override public Syntax getSyntax() { return new SyntaxImpl(this.typeDefinition.getContext(), this.registrationContext); }
@Override public Set<String> getStyles() { return Styles.gatherStyles(this.typeDefinition, this.typeDefinition.getContext().getContext().getConfiguration().getAnnotationStyles()); }
@Override public Set<String> getStyles() { return Styles.gatherStyles(this.typeDefinition, this.typeDefinition.getContext().getContext().getConfiguration().getAnnotationStyles()); }
private String findSpecifiedTypeInfoValue(Member member, String specifiedType, TypeDefinition type) { if (type == null) { return null; } else if (type.getTypeIdType() == JsonTypeInfo.Id.NAME && member.getSimpleName().toString().equals(type.getTypeIdProperty())) { JsonSubTypes subTypes = type.getAnnotation(JsonSubTypes.class); if (subTypes != null) { for (final JsonSubTypes.Type element : subTypes.value()) { DecoratedTypeMirror choiceType = Annotations.mirrorOf(new Callable<Class<?>>() { @Override public Class<?> call() throws Exception { return element.value(); } }, type.getContext().getContext().getProcessingEnvironment()); if (choiceType.isInstanceOf(specifiedType)) { return element.name(); } } return null; } } JsonType supertype = type instanceof ObjectTypeDefinition ? ((ObjectTypeDefinition)type).getSupertype() : null; if (supertype instanceof JsonClassType) { return findSpecifiedTypeInfoValue(member, specifiedType, ((JsonClassType) supertype).getTypeDefinition()); } return null; }
private String findSpecifiedTypeInfoValue(Member member, String specifiedType, TypeDefinition type) { if (type == null) { return null; } else if (type.getTypeIdType() == JsonTypeInfo.Id.NAME && member.getSimpleName().toString().equals(type.getTypeIdProperty())) { JsonSubTypes subTypes = type.getAnnotation(JsonSubTypes.class); if (subTypes != null) { for (final JsonSubTypes.Type element : subTypes.value()) { DecoratedTypeMirror choiceType = Annotations.mirrorOf(new Callable<Class<?>>() { @Override public Class<?> call() throws Exception { return element.value(); } }, type.getContext().getContext().getProcessingEnvironment()); if (choiceType.isInstanceOf(specifiedType)) { return element.name(); } } return null; } } JsonType supertype = type instanceof ObjectTypeDefinition ? ((ObjectTypeDefinition)type).getSupertype() : null; if (supertype instanceof JsonClassType) { return findSpecifiedTypeInfoValue(member, specifiedType, ((JsonClassType) supertype).getTypeDefinition()); } return null; }