Package com.sun.jersey.server.wadl.generators.resourcedoc.model

Examples of com.sun.jersey.server.wadl.generators.resourcedoc.model.MethodDocType


    {
        /* Set up a ClassDocType that has something for a custom-annotated parameter */
        ClassDocType cdt = new ClassDocType();
        cdt.setClassName(TestResource.class.getName());

        MethodDocType mdt = new MethodDocType();
        mdt.setMethodName("method");
        cdt.getMethodDocs().add(mdt);

        ParamDocType pdt = new ParamDocType("x", "comment about x");
        mdt.getParamDocs().add(pdt);

        AnnotationDocType adt = new AnnotationDocType();
        adt.setAnnotationTypeName(CustomParam.class.getName());
        adt.getAttributeDocs().add(new NamedValueType("value", "x"));

View Full Code Here


     * @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() ) ) {
View Full Code Here

    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;
    }
View Full Code Here

            // && 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;
    }
View Full Code Here

     * @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;
    }
View Full Code Here

     * @return
     * @see com.sun.jersey.server.impl.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;
    }
View Full Code Here

     * @return
     * @author Martin Grotzke
     */
    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( p, paramDocType, annotationDocType );
                        if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) {
View Full Code Here

    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;
    }
View Full Code Here

            // && 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;
    }
View Full Code Here

     * @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;
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.server.wadl.generators.resourcedoc.model.MethodDocType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.