Package org.exquery.serialization.annotation.MethodAnnotation

Examples of org.exquery.serialization.annotation.MethodAnnotation.SupportedMethod


               
                //serialization method
                final String methodProp = ((MethodAnnotation)serializationAnnotation).getMethod();
                serializationProperties.put(SerializationProperty.METHOD, methodProp);
               
                SupportedMethod method = null;
                try {
                    method = (methodProp == null ? SupportedMethod.xml : SupportedMethod.valueOf(methodProp));
                   
                    //set the default media-type for the method
                    final String defaultMethodMediaType = getDefaultMediaTypeForMethod(method);
View Full Code Here


     *
     * @throws RestXqServiceException 
     */
    protected void serializeBody(final Sequence result, final HttpResponse response, final Map<SerializationProperty, String> serializationProperties) throws RestXqServiceException {
       
        SupportedMethod method = null;
       
        try {
            final String methodProp = serializationProperties.get(SerializationProperty.METHOD);
            method = (methodProp == null ? SupportedMethod.xml : SupportedMethod.valueOf(methodProp));
        } catch(final IllegalArgumentException iae) {
            //do nothing

            //TODO debugging
            System.out.println(iae.getMessage());
        }
       
        //set the media-type
        final String mediaType = serializationProperties.get(SerializationProperty.MEDIA_TYPE);
        if(mediaType != null && !mediaType.isEmpty()) {
            response.setContentType(mediaType);
        }
       
        if(method != null && method.equals(SupportedMethod.binary)) {
            serializeBinaryBody(result, response);
        } else {
            serializeNodeBody(result, response, serializationProperties);
        }
    }
View Full Code Here

TOP

Related Classes of org.exquery.serialization.annotation.MethodAnnotation.SupportedMethod

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.