@Override public ApiRegistry getApiRegistry() { return new Jackson1ApiRegistry(this.jacksonContext); }
@Override public Void visitUnknown(TypeMirror t, ReferenceContext context) { return defaultAction(t, context); }
public boolean isKnownTypeDefinition(TypeElement el) { return findTypeDefinition(el) != null || isKnownType(el); }
@Override public void call(EnunciateContext context) { if ((this.jacksonModule == null || this.jacksonModule.getJacksonContext() == null || this.jacksonModule.getJacksonContext().getTypeDefinitions().isEmpty()) && (this.jackson1Module == null || this.jackson1Module.getJacksonContext() == null || this.jackson1Module.getJacksonContext().getTypeDefinitions().isEmpty())) { info("No Jackson JSON data types: GWT JSON overlays will be generated."); return; } detectAccessorNamingErrors(); File sourceDir = generateClientSources(); packageArtifacts(sourceDir); }
@Override public boolean isEmpty() { return this.context.getTypeDefinitions().isEmpty(); }
public EnunciateContext getContext() { return jacksonContext == null ? jackson1Context.getContext() : jacksonContext.getContext(); }
protected void addPotentialJacksonElement(Element declaration, LinkedList<Element> contextStack) { if (declaration instanceof TypeElement) { if (!this.jacksonContext.isKnownTypeDefinition((TypeElement) declaration) && isExplicitTypeDefinition(declaration, this.jacksonContext.isHonorJaxb())) { OneTimeLogMessage.JACKSON_1_DEPRECATED.log(this.context); this.jacksonContext.add(this.jacksonContext.createTypeDefinition((TypeElement) declaration), contextStack); } } }
@Override public void addDataTypeDefinitions(TypeMirror type, Set<String> declaredMediaTypes, LinkedList<Element> contextStack) { if (MediaTypeUtils.isJsonCompatible(declaredMediaTypes)) { type = this.jacksonContext.resolveSyntheticType((DecoratedTypeMirror) type); this.jacksonContext.addReferencedTypeDefinitions(type, contextStack); } else { debug("Element %s is NOT to be added as a Jackson data type because %s doesn't seem to include JSON.", type, declaredMediaTypes); } }
/** * Adds any referenced type definitions for the specified type mirror. * * @param type The type mirror. */ protected void addReferencedTypeDefinitions(TypeMirror type, LinkedList<Element> stack) { type.accept(new ReferencedJsonDefinitionVisitor(), new ReferenceContext(stack)); }
@Override public String getSlug() { return "json_" + this.typeDefinition.getContext().getSlug(this.typeDefinition); }
@Override public boolean typeDetected(Object type, MetadataAdapter metadata) { List<String> classAnnotations = metadata.getClassAnnotationNames(type); if (classAnnotations != null) { for (String fqn : classAnnotations) { if (isJacksonSerializationAnnotation(fqn)) { return true; } } } return false; }
@Override public boolean isEmpty() { return this.context.getTypeDefinitions().isEmpty(); }
protected void addPotentialJacksonElement(Element declaration, LinkedList<Element> contextStack) { if (declaration instanceof TypeElement) { if (!this.jacksonContext.isKnownTypeDefinition((TypeElement) declaration) && isExplicitTypeDefinition(declaration, this.jacksonContext.isHonorJaxb())) { OneTimeLogMessage.JACKSON_1_DEPRECATED.log(this.context); this.jacksonContext.add(this.jacksonContext.createTypeDefinition((TypeElement) declaration), contextStack); } } }
@Override public void addDataTypeDefinitions(TypeMirror type, Set<String> declaredMediaTypes, LinkedList<Element> contextStack) { if (MediaTypeUtils.isJsonCompatible(declaredMediaTypes)) { type = this.jacksonContext.resolveSyntheticType((DecoratedTypeMirror) type); this.jacksonContext.addReferencedTypeDefinitions(type, contextStack); } else { debug("Element %s is NOT to be added as a Jackson data type because %s doesn't seem to include JSON.", type, declaredMediaTypes); } }
/** * Adds any referenced type definitions for the specified type mirror. * * @param type The type mirror. */ protected void addReferencedTypeDefinitions(TypeMirror type, LinkedList<Element> stack) { type.accept(new ReferencedJsonDefinitionVisitor(), new ReferenceContext(stack)); }
public boolean isKnownTypeDefinition(TypeElement el) { return findTypeDefinition(el) != null || isKnownType(el); }
@Override public String getSlug() { return "json_" + this.typeDefinition.getContext().getSlug(this.typeDefinition); }
@Override public ApiRegistry getApiRegistry() { return new Jackson1ApiRegistry(this.jacksonContext); }
@Override public Void visitUnknown(TypeMirror t, ReferenceContext context) { return defaultAction(t, context); }
@Override public boolean typeDetected(Object type, MetadataAdapter metadata) { List<String> classAnnotations = metadata.getClassAnnotationNames(type); if (classAnnotations != null) { for (String fqn : classAnnotations) { if (isJacksonSerializationAnnotation(fqn)) { return true; } } } return false; }