Package org.exquery.xquery

Examples of org.exquery.xquery.Literal


            annotations.addAll(resourceFn.getProducesAnnotations());
           
            for(final Annotation annotation : annotations) {
                builder.startElement(QName.fromJavaQName(annotation.getName()), null);
               
                final Literal literals[] =  annotation.getLiterals();
                if(literals != null) {
                    for(final Literal literal : literals) {
                        if(annotation instanceof ConsumesAnnotation || annotation instanceof ProducesAnnotation) {
                            builder.startElement(INTERNET_MEDIA_TYPE, null);
                            builder.characters(literal.getValue());
View Full Code Here


    @Test
    public void json_mediaType() throws SerializationAnnotationException {
        final String JSON_MEDIATYPE = "application/json";
       
        final MediaTypeAnnotation mediaTypeAnnotation = new MediaTypeAnnotation();
        final String mediaType = mediaTypeAnnotation.parseMediaType(new Literal(){

            @Override
            public Type getType() {
                return Type.STRING;
            }
View Full Code Here

    @Test
    public void ooxml_mediaType() throws SerializationAnnotationException {
        final String OOXML_MEDIATYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
       
        final MediaTypeAnnotation mediaTypeAnnotation = new MediaTypeAnnotation();
        final String mediaType = mediaTypeAnnotation.parseMediaType(new Literal(){

            @Override
            public Type getType() {
                return Type.STRING;
            }
View Full Code Here

        final String OOXML_MEDIATYPE = "application/vnd/openxmlformats";
       
        final MediaTypeAnnotation mediaTypeAnnotation = new MediaTypeAnnotation();
       
        try {
            final String mediaType = mediaTypeAnnotation.parseMediaType(new Literal(){

                @Override
                public Type getType() {
                    return Type.STRING;
                }
View Full Code Here

            @Override
            public Sequence<String> getTypedValue() {
                final Object queryParam = request.getQueryParam(getParameterAnnotationMapping().getParameterName());
                if(queryParam == null) {
                   
                    final Literal defaultLiterals[] = getParameterAnnotationMapping().getDefaultValues();
                    if(defaultLiterals.length > 0) {
                        return literalsToSequence(defaultLiterals);
                    } else {
                        return Sequence.EMPTY_SEQUENCE;
                    }
View Full Code Here

       
        if(annotationValue.length != 1) {
            throw new RestAnnotationException(RestXqErrorCodes.RQST0001);
        }
       
        final Literal pathValue = annotationValue[0];
        if(pathValue.getType() != Type.STRING) {
            throw new RestAnnotationException(RestXqErrorCodes.RQST0002);
        }
       
        final String pathStr = pathValue.getValue();
        if(pathStr.isEmpty()) {
            throw new RestAnnotationException(RestXqErrorCodes.RQST0003);
        }

        //validate the Path
View Full Code Here

            @Override
            public Sequence getTypedValue() {
                final Object formParam = request.getFormParam(getParameterAnnotationMapping().getParameterName());
                if(formParam == null) {
                    final Literal defaultLiterals[] = getParameterAnnotationMapping().getDefaultValues();
                    return literalsToSequence(defaultLiterals);
                }
               
                if(formParam instanceof String) {
                    return new SequenceImpl(new StringTypedValue((String)formParam));
View Full Code Here

            @Override
            public Sequence<String> getTypedValue() {
                final Object queryParam = request.getHeader(getParameterAnnotationMapping().getParameterName());
                if(queryParam == null) {
                   
                    final Literal defaultLiterals[] = getParameterAnnotationMapping().getDefaultValues();
                    if(defaultLiterals.length > 0) {
                        return literalsToSequence(defaultLiterals);
                    } else {
                        return Sequence.EMPTY_SEQUENCE;
                    }
View Full Code Here

            @Override
            public Sequence<String> getTypedValue() {
                final Object queryParam = request.getCookieValue(getParameterAnnotationMapping().getParameterName());
                if(queryParam == null) {
                   
                    final Literal defaultLiterals[] = getParameterAnnotationMapping().getDefaultValues();
                    if(defaultLiterals.length > 0) {
                        return literalsToSequence(defaultLiterals);
                    } else {
                        return Sequence.EMPTY_SEQUENCE;
                    }
View Full Code Here

TOP

Related Classes of org.exquery.xquery.Literal

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.