@Override public String getResponseLang() { if (this.responseDescriptor == null) { return null; } String lang = "txt"; com.webcohesion.enunciate.api.datatype.Example example = this.responseDescriptor.getExample(); if (example != null) { lang = example.getLang(); } return lang; }
@Override public String getResponseLang() { if (this.responseDescriptor == null) { return null; } String lang = "txt"; com.webcohesion.enunciate.api.datatype.Example example = this.responseDescriptor.getExample(); if (example != null) { lang = example.getLang(); } return lang; }
@Override public String getRequestLang() { if (this.requestDescriptor == null) { return null; } String lang = "txt"; com.webcohesion.enunciate.api.datatype.Example example = this.requestDescriptor.getExample(); if (example != null) { lang = example.getLang(); } return lang; }
@Override public String getResponseBody() { if (this.responseDescriptor == null) { return null; } String body = "..."; com.webcohesion.enunciate.api.datatype.Example example = this.responseDescriptor.getExample(); if (example != null) { body = example.getBody(); } return body; } }
@Override public String getRequestLang() { if (this.requestDescriptor == null) { return null; } String lang = "txt"; com.webcohesion.enunciate.api.datatype.Example example = this.requestDescriptor.getExample(); if (example != null) { lang = example.getLang(); } return lang; }
@Override public String getRequestBody() { if (this.requestDescriptor == null) { return null; } String body = "..."; com.webcohesion.enunciate.api.datatype.Example example = this.requestDescriptor.getExample(); if (example != null) { body = example.getBody(); } return body; }
@Override public String getRequestBody() { if (this.requestDescriptor == null) { return null; } String body = "..."; com.webcohesion.enunciate.api.datatype.Example example = this.requestDescriptor.getExample(); if (example != null) { body = example.getBody(); } return body; }
@Override public String getResponseBody() { if (this.responseDescriptor == null) { return null; } String body = "..."; com.webcohesion.enunciate.api.datatype.Example example = this.responseDescriptor.getExample(); if (example != null) { body = example.getBody(); } return body; } }
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; }
example = descriptor.getExample();
@Override public List<? extends MediaTypeDescriptor> getMediaTypes() { ArrayList<MediaTypeDescriptor> mts = new ArrayList<MediaTypeDescriptor>(); DecoratedTypeMirror type = this.responseCode.getType(); if (type != null) { ResourceMethod resourceMethod = this.responseCode.getResourceMethod(); Set<MediaType> produces = resourceMethod.getProducesMediaTypes(); for (com.webcohesion.enunciate.modules.jaxrs.model.util.MediaType mt : produces) { for (Syntax syntax : resourceMethod.getContext().getContext().getApiRegistry().getSyntaxes(registrationContext)) { MediaTypeDescriptor descriptor = syntax.findMediaTypeDescriptor(mt.getMediaType(), type); if (descriptor != null) { mts.add(new MediaTypeDescriptorImpl(descriptor, mt, descriptor.getExample())); } } } } return mts; }
example = descriptor.getExample();