/** * * @param resourceClass * @param method * @param p * @return param doc type */ public ParamDocType getParamDoc( Class<?> resourceClass, Method method, Parameter p ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); if ( methodDoc != null ) { for ( ParamDocType paramDocType : methodDoc.getParamDocs() ) { for ( AnnotationDocType annotationDocType : paramDocType.getAnnotationDocs() ) { final Class<? extends Annotation> annotationType = p.getAnnotation().annotationType(); if ( annotationType != null ) { final String sourceName = getSourceName(annotationDocType); if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) { return paramDocType; } } } } } return null; }
/** * @param r * @param m * @return the enhanced {@link Method} * @see com.sun.jersey.server.wadl.WadlGenerator#createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod) */ public Method createMethod( AbstractResource r, AbstractResourceMethod m ) { final Method result = _delegate.createMethod( r, m ); final MethodDocType methodDoc = resourceDoc.getMethodDoc( r.getResourceClass(), m.getMethod() ); if ( methodDoc != null && !isEmpty( methodDoc.getCommentText() ) ) { final Doc doc = new Doc(); doc.getContent().add( methodDoc.getCommentText() ); // doc.getOtherAttributes().put( new QName( "xmlns" ), "http://www.w3.org/1999/xhtml" ); result.getDoc().add( doc ); } return result; }
public MethodDocType getMethodDoc( Class<?> resourceClass, Method method ) { final ClassDocType classDoc = getClassDoc( resourceClass ); if ( classDoc != null ) { for ( MethodDocType methodDocType : classDoc.getMethodDocs() ) { if (method != null && method.getName().equals(methodDocType.getMethodName())) { return methodDocType; } } } return null; }
final MethodDocType methodDocType = new MethodDocType(); methodDocType.setMethodName( methodDoc.name() ); methodDocType.setCommentText( generateComment( methodDoc ) );
public RepresentationDocType getRequestRepresentation( Class<?> resourceClass, Method method, String mediaType ) { if ( mediaType == null ) { return null; } final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); return methodDoc != null && methodDoc.getRequestDoc() != null && methodDoc.getRequestDoc().getRepresentationDoc() != null // && mediaType.equals( methodDoc.getRequestDoc().getRepresentationDoc().getMediaType() ) ? methodDoc.getRequestDoc().getRepresentationDoc() : null; }
public ResponseDocType getResponse( Class<?> resourceClass, Method method ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); return methodDoc != null && methodDoc.getResponseDoc() != null ? methodDoc.getResponseDoc() : null; }
private static void addRequestRepresentationDoc(MethodDoc methodDoc, final MethodDocType methodDocType, Collection<String> expand, List<Module> modules) { final Tag requestElement = getSingleTagOrNull( methodDoc, "request.representation.qname" ); final Tag requestExample = getSingleTagOrNull( methodDoc, "request.representation.example" ); if ( requestElement != null || requestExample != null ) { final RequestDocType requestDoc = new RequestDocType(); final RepresentationDocType representationDoc = new RepresentationDocType(); /* requestElement exists */ if ( requestElement != null ) { representationDoc.setElement( QName.valueOf( requestElement.text() ) ); } /* requestExample exists */ if ( requestExample != null ) { final String example = getSerializedExample( requestExample, expand, modules); if ( !isEmpty( example ) ) { representationDoc.setExample( example ); } else { LOG.warning( "Could not get serialized example for method " + methodDoc.qualifiedName() ); } } requestDoc.setRepresentationDoc( representationDoc ); methodDocType.setRequestDoc( requestDoc ); } }
final MethodDocType methodDocType = new MethodDocType(); methodDocType.setMethodName( methodDoc.name() ); methodDocType.setCommentText( methodDoc.commentText() ); docProcessor.processMethodDoc( methodDoc, methodDocType );
public RepresentationDocType getRequestRepresentation( Class<?> resourceClass, Method method, String mediaType ) { if ( mediaType == null ) { return null; } final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); return methodDoc != null && methodDoc.getRequestDoc() != null && methodDoc.getRequestDoc().getRepresentationDoc() != null // && mediaType.equals( methodDoc.getRequestDoc().getRepresentationDoc().getMediaType() ) ? methodDoc.getRequestDoc().getRepresentationDoc() : null; }
public ResponseDocType getResponse( Class<?> resourceClass, Method method ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); return methodDoc != null && methodDoc.getResponseDoc() != null ? methodDoc.getResponseDoc() : null; }
/** * * @param resourceClass * @param method * @param p * @return param doc type */ public ParamDocType getParamDoc( Class<?> resourceClass, Method method, Parameter p ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); if ( methodDoc != null ) { for ( ParamDocType paramDocType : methodDoc.getParamDocs() ) { for ( AnnotationDocType annotationDocType : paramDocType.getAnnotationDocs() ) { final Class<? extends Annotation> annotationType = p.getAnnotation().annotationType(); if ( annotationType != null ) { final String sourceName = getSourceName(annotationDocType); if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) { return paramDocType; } } } } } return null; }
public RepresentationDocType getRequestRepresentation( Class<?> resourceClass, Method method, String mediaType ) { if ( mediaType == null ) { return null; } final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); return methodDoc != null && methodDoc.getRequestDoc() != null && methodDoc.getRequestDoc().getRepresentationDoc() != null // && mediaType.equals( methodDoc.getRequestDoc().getRepresentationDoc().getMediaType() ) ? methodDoc.getRequestDoc().getRepresentationDoc() : null; }
public MethodDocType getMethodDoc( Class<?> resourceClass, Method method ) { final ClassDocType classDoc = getClassDoc( resourceClass ); if ( classDoc != null ) { for ( MethodDocType methodDocType : classDoc.getMethodDocs() ) { if (method != null && method.getName().equals(methodDocType.getMethodName())) { return methodDocType; } } } return null; }
public ResponseDocType getResponse( Class<?> resourceClass, Method method ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); return methodDoc != null && methodDoc.getResponseDoc() != null ? methodDoc.getResponseDoc() : null; }
/** * @param r * @param m * @return the enhanced {@link Method} * @see com.sun.jersey.server.wadl.WadlGenerator#createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod) */ public Method createMethod( AbstractResource r, AbstractResourceMethod m ) { final Method result = _delegate.createMethod( r, m ); final MethodDocType methodDoc = resourceDoc.getMethodDoc( r.getResourceClass(), m.getMethod() ); if ( methodDoc != null && !isEmpty( methodDoc.getCommentText() ) ) { final Doc doc = new Doc(); doc.getContent().add( methodDoc.getCommentText() ); // doc.getOtherAttributes().put( new QName( "xmlns" ), "http://www.w3.org/1999/xhtml" ); result.getDoc().add( doc ); } return result; }
/** * * @param resourceClass * @param method * @param p * @return param doc type */ public ParamDocType getParamDoc( Class<?> resourceClass, Method method, Parameter p ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); if ( methodDoc != null ) { for ( ParamDocType paramDocType : methodDoc.getParamDocs() ) { for ( AnnotationDocType annotationDocType : paramDocType.getAnnotationDocs() ) { final Class<? extends Annotation> annotationType = p.getAnnotation().annotationType(); if ( annotationType != null ) { final String sourceName = getSourceName(annotationDocType); if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) { return paramDocType; } } } } } return null; }
public MethodDocType getMethodDoc( Class<?> resourceClass, Method method ) { final ClassDocType classDoc = getClassDoc( resourceClass ); if ( classDoc != null ) { for ( MethodDocType methodDocType : classDoc.getMethodDocs() ) { if (method != null && method.getName().equals(methodDocType.getMethodName())) { return methodDocType; } } } return null; }
/** * @param r * @param m * @return the enhanced {@link Method} * @see com.sun.jersey.server.wadl.WadlGenerator#createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod) */ public Method createMethod( AbstractResource r, AbstractResourceMethod m ) { final Method result = _delegate.createMethod( r, m ); final MethodDocType methodDoc = resourceDoc.getMethodDoc( r.getResourceClass(), m.getMethod() ); if ( methodDoc != null && !isEmpty( methodDoc.getCommentText() ) ) { final Doc doc = new Doc(); doc.getContent().add( methodDoc.getCommentText() ); // doc.getOtherAttributes().put( new QName( "xmlns" ), "http://www.w3.org/1999/xhtml" ); result.getDoc().add( doc ); } return result; }
methodDocType.getParamDocs().add( paramDocType );