protected Example loadExample(Syntax syntax, MediaTypeDescriptor descriptor) { Example example = ExampleUtils.loadCustomExample(syntax, "requestExample", this.resourceMethod, this.resourceMethod.getContext().getContext()); if (example == null) { example = descriptor.getExample(); if (this.entityParameter != null) { DocumentationExample documentationExample = this.entityParameter.getAnnotation(DocumentationExample.class); if (documentationExample != null) { TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), this.resourceMethod.getContext().getContext().getProcessingEnvironment(), null); if (typeHint instanceof DeclaredType) { Element element = ((DeclaredType) typeHint).asElement(); if (element instanceof TypeElement) { List<DataType> dataTypes = syntax.findDataTypes(((TypeElement) element).getQualifiedName().toString()); if (dataTypes != null && !dataTypes.isEmpty()) { example = dataTypes.get(0).getExample(); } } } } } } return example; }
protected Example loadExample(Syntax syntax, MediaTypeDescriptor descriptor) { Example example = ExampleUtils.loadCustomExample(syntax, "requestExample", this.requestMapping, this.requestMapping.getContext().getContext()); if (example == null) { example = descriptor.getExample(); if (this.entityParameter != null) { DocumentationExample documentationExample = this.entityParameter.getAnnotation(DocumentationExample.class); if (documentationExample != null) { TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), this.requestMapping.getContext().getContext().getProcessingEnvironment(), null); if (typeHint instanceof DeclaredType) { Element element = ((DeclaredType) typeHint).asElement(); if (element instanceof TypeElement) { List<DataType> dataTypes = syntax.findDataTypes(((TypeElement) element).getQualifiedName().toString()); if (dataTypes != null && !dataTypes.isEmpty()) { example = dataTypes.get(0).getExample(); } } } } } } return example; }
protected DecoratedTypeMirror loadType() { TypeHint hint = getAnnotation(TypeHint.class); if (hint != null) { return (DecoratedTypeMirror) TypeHintUtils.getTypeHint(hint, context.getContext().getContext().getProcessingEnvironment(), asType()); } return (DecoratedTypeMirror) asType(); }
public DecoratedTypeMirror loadType() { TypeHint hint = getAnnotation(TypeHint.class); if (hint != null) { return (DecoratedTypeMirror) TypeHintUtils.getTypeHint(hint, getContext().getContext().getContext().getProcessingEnvironment(), asType()); } return (DecoratedTypeMirror) asType(); }
public ResourceEntityParameter(ResourceMethod method, VariableElement delegate, TypeVariableContext variableContext, EnunciateJaxrsContext context) { super(delegate, context.getContext().getProcessingEnvironment()); TypeMirror typeMirror; final TypeHint hintInfo = getAnnotation(TypeHint.class); if (hintInfo != null) { typeMirror = TypeHintUtils.getTypeHint(hintInfo, this.env, delegate.asType()); } else { typeMirror = delegate.asType(); if (getJavaDoc().get("inputWrapped") != null) { //support jax-doclets. see http://jira.codehaus.org/browse/ENUNCIATE-690 String fqn = getJavaDoc().get("inputWrapped").get(0); TypeElement type = env.getElementUtils().getTypeElement(fqn); if (type != null) { typeMirror = TypeMirrorDecorator.decorate(env.getTypeUtils().getDeclaredType(type), this.env); } } } typeMirror = TypeMirrorDecorator.decorate(typeMirror, this.env); if (((DecoratedTypeMirror)typeMirror).isInstanceOf(java.io.InputStream.class)) { //special case for input stream: just treat it as a generic object. typeMirror = this.env.getElementUtils().getTypeElement(Object.class.getName()).asType(); } else { //now resolve any type variables. typeMirror = variableContext.resolveTypeVariables(typeMirror, this.env); } this.type = typeMirror; }
TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), this.requestMapping.getContext().getContext().getProcessingEnvironment(), null); if (typeHint instanceof DeclaredType) { Element element = ((DeclaredType) typeHint).asElement();
TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), this.resourceMethod.getContext().getContext().getProcessingEnvironment(), null); if (typeHint instanceof DeclaredType) { Element element = ((DeclaredType) typeHint).asElement();
public ResourceEntityParameter(VariableElement delegate, TypeVariableContext variableContext, EnunciateSpringWebContext context) { super(delegate, context.getContext().getProcessingEnvironment()); TypeMirror typeMirror; final TypeHint hintInfo = getAnnotation(TypeHint.class); if (hintInfo != null) { typeMirror = TypeHintUtils.getTypeHint(hintInfo, this.env, delegate.asType()); } else { typeMirror = delegate.asType(); if (getJavaDoc().get("inputWrapped") != null) { //support jax-doclets. see http://jira.codehaus.org/browse/ENUNCIATE-690 String fqn = getJavaDoc().get("inputWrapped").get(0); TypeElement type = env.getElementUtils().getTypeElement(fqn); if (type != null) { typeMirror = TypeMirrorDecorator.decorate(env.getTypeUtils().getDeclaredType(type), this.env); } } } //now resolve any type variables. typeMirror = variableContext.resolveTypeVariables(typeMirror, this.env); this.type = typeMirror; }
TypeHint hintInfo = member.getAnnotation(TypeHint.class); if (hintInfo != null) { TypeMirror hint = TypeHintUtils.getTypeHint(hintInfo, context.getProcessingEnvironment(), null); if (hint != null) { addReferencedTypeDefinitions(hint, stack);
TypeHint hintInfo = member.getAnnotation(TypeHint.class); if (hintInfo != null) { TypeMirror hint = TypeHintUtils.getTypeHint(hintInfo, context.getProcessingEnvironment(), null); if (hint != null) { addReferencedTypeDefinitions(hint, stack);
TypeHint hintInfo = member.getAnnotation(TypeHint.class); if (hintInfo != null) { TypeMirror hint = TypeHintUtils.getTypeHint(hintInfo, context.getProcessingEnvironment(), null); if (hint != null) { addReferencedTypeDefinitions(hint, stack);
TypeHint hintInfo = member.getAnnotation(TypeHint.class); if (hintInfo != null) { TypeMirror hint = TypeHintUtils.getTypeHint(hintInfo, context.getProcessingEnvironment(), null); if (hint != null) { addReferencedTypeDefinitions(hint, stack);
rc.setType((DecoratedTypeMirror) TypeHintUtils.getTypeHint(code.type(), this.env, null)); rc.setType((DecoratedTypeMirror) TypeHintUtils.getTypeHint(code.type(), this.env, null));
TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), type.getContext().getContext().getProcessingEnvironment(), null); if (typeHint != null) { baseType = XmlTypeFactory.getXmlType(typeHint, type.getContext());
TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), type.getContext().getContext().getProcessingEnvironment(), null); if (typeHint != null) { baseType = XmlTypeFactory.getXmlType(typeHint, type.getContext());
example2 = documentationExample.value2(); example2 = "##default".equals(example2) ? null : example2; TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), type.getContext().getContext().getProcessingEnvironment(), null); if (typeHint != null) { exampleType = JsonTypeFactory.getJsonType(typeHint, type.getContext());
JavaDoc localDoc = new JavaDoc(getDocComment(), null, null, this.env); if (hintInfo != null) { returnType = (DecoratedTypeMirror) TypeHintUtils.getTypeHint(hintInfo, this.env, null); if (returnType != null) { returnType.setDeferredDocComment(new ReturnDocComment(this)); rc.setAdditionalHeader(header.name(), header.description()); rc.setType((DecoratedTypeMirror) TypeHintUtils.getTypeHint(code.type(), this.env, null)); statusCodes.add(rc); rc.setAdditionalHeader(header.name(), header.description()); rc.setType((DecoratedTypeMirror) TypeHintUtils.getTypeHint(code.type(), this.env, null)); statusCodes.add(rc);
example2 = documentationExample.value2(); example2 = "##default".equals(example2) ? null : example2; TypeMirror typeHint = TypeHintUtils.getTypeHint(documentationExample.type(), type.getContext().getContext().getProcessingEnvironment(), null); if (typeHint != null) { exampleType = JsonTypeFactory.getJsonType(typeHint, type.getContext());
JavaDoc localDoc = new JavaDoc(getDocComment(), null, null, this.env); if (hintInfo != null) { returnType = (DecoratedTypeMirror) TypeHintUtils.getTypeHint(hintInfo, this.env, null); if (returnType != null) { returnType.setDeferredDocComment(new ReturnDocComment(this)); rc.setAdditionalHeader(header.name(), header.description()); rc.setType((DecoratedTypeMirror) TypeHintUtils.getTypeHint(code.type(), this.env, null)); statusCodes.add(rc); rc.setAdditionalHeader(header.name(), header.description()); rc.setType((DecoratedTypeMirror) TypeHintUtils.getTypeHint(code.type(), this.env, null)); statusCodes.add(rc);
TypeHint hintInfo = getAnnotation(TypeHint.class); if (hintInfo != null) { returnType = (DecoratedTypeMirror) TypeHintUtils.getTypeHint(hintInfo, this.env, getReturnType()); returnType.setDeferredDocComment(new ReturnDocComment(this));