Package org.exquery.restxq.annotation

Examples of org.exquery.restxq.annotation.RestAnnotationException


     */
    protected String parseAnnotationValue() throws RestAnnotationException {
        final Literal[] annotationLiterals = getLiterals();
       
        if(annotationLiterals.length > 1) {
            throw new RestAnnotationException(RestXqErrorCodes.RQST0010);
        } else if(annotationLiterals.length != 1) {
            return null;
        } else {
            return parseMethodBodyValue(annotationLiterals[0]);
        }
View Full Code Here


     * the variable it binds does not match the function signature
     */
    protected String parseMethodBodyValue(final Literal methodValue) throws RestAnnotationException {
       
        if(methodValue.getType() != Type.STRING) {
            throw new RestAnnotationException(RestXqErrorCodes.RQST0011);
        }
       
        final String methodStr = methodValue.getValue();
        if(methodStr.isEmpty()) {
            throw new RestAnnotationException(RestXqErrorCodes.RQST0012);
        }

        //validate the methodStr
        final Matcher mtcFunctionArgument = functionArgumentPattern.matcher(methodStr);
       
        if(!mtcFunctionArgument.matches()) {
            throw new RestAnnotationException(RestXqErrorCodes.RQST0013);
        }

        final String bodyContentParamName = mtcFunctionArgument.group(1);

        //check the function that has this annotation has parameters as declared by the annotation
View Full Code Here

TOP

Related Classes of org.exquery.restxq.annotation.RestAnnotationException

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.