Examples of ParserError


Examples of com.volantis.mcs.xml.validation.sax.ParserError

                //////////////////////////////////////////////////////////

                // this error will occur when a given element is not allowed
                // at the given location. The param string in reported
                // errors will name that element
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-complex-type.2.4.a",
                        FaultTypes.INVALID_ELEMENT_LOCATION,
                        0,
                        false));

                // this error will occur when a given elements conent is
                // invalid
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-complex-type.2.4.b",
                        FaultTypes.INVALID_ELEMENT_CONTENT,
                        0,
                        false));

                // this error will occur when a given child element is not
                // allowed at the given location. The param string in reported
                // errors will name that element
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-complex-type.2.4.d",
                        FaultTypes.INVALID_ELEMENT_LOCATION,
                        0,
                        false));

                // this error will occur when a given attribute is not
                // allowed at the given location. The param string in
                // reported errors will name that attribute
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-complex-type.3.2.2",
                        FaultTypes.INVALID_ATTRIBUTE_LOCATION,
                        0,
                        true));

                // this error will occur when a given elements content
                // does not match its declared type. The param string
                // will name that element
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-type.3.1.3",
                        FaultTypes.INVALID_ELEMENT_CONTENT,
                        1,
                        false));

                // this error will occur when a given attributes value
                // does not match its declared type. The param string
                // will name that attribute
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-attribute.3",
                        FaultTypes.INVALID_ATTRIBUTE_CONTENT,
                        1,
                        true));

                // this error will occur when a required attribute is missing
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-complex-type.4",
                        FaultTypes.MISSING_ATTRIBUTE,
                        0,
                        true));

                // this error will occur when a given attributes value
                // is not of the declared type
                parserErrors.add(new AttributeResolvingParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-datatype-valid.1.2.1",
                        FaultTypes.INVALID_SCHEMA_DATA_TYPE,
                        0));

                // this error will occur when a given attributes value
                // is not of the declared type
                parserErrors.add(new AttributeResolvingParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-datatype-valid.1.2.2",
                        FaultTypes.INVALID_POLICY_NAME,
                        0));

                // this error will occur when a given elements value
                // is not of the declared type
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-datatype-valid.1.2.1",
                        FaultTypes.INVALID_SCHEMA_DATA_TYPE,
                        0,
                        false));

                // this error will occur when a required attribute is missing
                parserErrors.add(new AttributeResolvingParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-enumeration-valid",
                        FaultTypes.INVALID_SELECTION,
                        0));

                // this error will occur when a required attribute is missing
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-enumeration-valid",
                        FaultTypes.INVALID_SELECTION,
                        0,
                        false));

                // this error will occur when a given attributes value
                // is not of the declared type
                parserErrors.add(new AttributeResolvingParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-pattern-valid",
                        FaultTypes.INVALID_SCHEMA_PATTERN_VALUE,
                        0));

                // this error will occur when a given elements value
                // is not of the declared type
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-pattern-valid",
                        FaultTypes.INVALID_SCHEMA_PATTERN_VALUE,
                        0,
                        false));

                // this error will occur when a schema constraint key is
                // not found
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "KeyNotFound",
                        FaultTypes.SCHEMA_CONSTRAINT_VIOLATED,
                        0,
                        false));

                // this error will occur when a schema constraint key is
                // violated
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "DuplicateKey",
                        FaultTypes.DUPLICATE_NAME,
                        0,
                        false));

                // this error will occur when an attribute has exceeded
                // a max inclusive constraint. The error param will
                // contain the value that is in error. THIS ERROR MUST PRECEED
                // THE PARSER element equivalent for "cvc-maxInclusive-valid"
                parserErrors.add(new AttributeResolvingParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-maxInclusive-valid",
                        FaultTypes.MAX_INCLUSIVE_VIOLATED,
                        0));

                // this error will occur when an elemnt has exceeded
                // a max inclusive constraint. The error param will
                // contain the value that is in error
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-maxInclusive-valid",
                        FaultTypes.MAX_INCLUSIVE_VIOLATED,
                        0,
                        false));

                // this error will occur when an attribute has exceeded
                // a min inclusive constraint. The error param will
                // contain the value that is in error. THIS ERROR MUST PRECEED
                // THE PARSER element equivalent for "cvc-minInclusive-valid"
                parserErrors.add(new AttributeResolvingParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-minInclusive-valid",
                        FaultTypes.MIN_INCLUSIVE_VIOLATED,
                        0));

                // this error will occur when an element has exceeded
                // a min inclusive constraint. The error param will
                // contain the value that is in error
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-minInclusive-valid",
                        FaultTypes.MIN_INCLUSIVE_VIOLATED,
                        0,
                        false));

                // this error will occur when an attribute has exceeded
                // a max length constraint. The error param will
                // name the attribute that is in error. THIS ERROR MUST PRECEED
                // THE PARSER element equivalent for "cvc-maxInclusive-valid"
                parserErrors.add(new AttributeResolvingParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-maxLength-valid",
                        FaultTypes.MAX_LENGTH_VIOLATED,
                        0));

                // this error will occur when an elemnt has exceeded
                // a max length constraint. The error param will
                // contain the value that is in error
                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "cvc-maxLength-valid",
                        FaultTypes.MAX_LENGTH_VIOLATED,
                        0,
                        false));

                parserErrors.add(new ParserError(
                        XSD_MESSAGE_BUNDLE,
                        "DuplicateUnique",
                        FaultTypes.DUPLICATE_UNIQUE,
                        0,
                        false));
View Full Code Here

Examples of dtool.parser.ParserError

  }
 
  /* ---- error helpers ---- */
 
  protected ParserError createError(ParserErrorTypes errorType, SourceRange sr, Object msgData) {
    return new ParserError(errorType, sr, sr.getRangeSubString(getSource()), msgData);
  }
View Full Code Here

Examples of dtool.parser.ParserError

 
  protected final BaseLexElement consumeExpectedContentToken(DeeTokens expectedTokenType) {
    if(lookAhead() == expectedTokenType) {
      return consumeLookAhead();
    } else {
      ParserError error = createExpectedTokenError(expectedTokenType);
      BaseLexElement missingToken = consumeSubChannelTokens(error);
      return missingToken;
    }
  }
View Full Code Here

Examples of org.drools.compiler.ParserError

        } else {
            ProcessValidationError[] errors = validator.validateProcess( (WorkflowProcess) process );
            if ( errors.length != 0 ) {
                hasErrors = true;
                for ( int i = 0; i < errors.length; i++ ) {
                    this.errors.add( new ParserError( errors[i].toString(),
                                                      -1,
                                                      -1 ) );
                }
            }
        }
View Full Code Here

Examples of org.drools.compiler.ParserError

    protected void markParseErrors(List<DroolsBuildMarker> markers,
                                   List<DroolsError> parserErrors) {
        for ( Iterator<DroolsError> iter = parserErrors.iterator(); iter.hasNext(); ) {
            Object error = iter.next();
            if ( error instanceof ParserError ) {
                ParserError err = (ParserError) error;
                markers.add( new DroolsBuildMarker( err.getMessage(),
                                                    err.getRow() ) );
            } else if ( error instanceof KnowledgeBuilderResult ) {
              KnowledgeBuilderResult res = (KnowledgeBuilderResult)error;
              int[] errorLines = res.getLines();
                markers.add( new DroolsBuildMarker( res.getMessage(),
                                  errorLines != null && errorLines.length > 0 ? errorLines[0] : -1 ) );
View Full Code Here

Examples of org.drools.compiler.ParserError

                } else {
                    markers.add( new DroolsBuildMarker( ruleError.getRule().getName() + ":" + ruleError.getMessage(),
                                                        ruleError.getLine() ) );
                }
            } else if ( error instanceof ParserError ) {
                ParserError parserError = (ParserError) error;
                // TODO try to retrieve character start-end
                markers.add( new DroolsBuildMarker( parserError.getMessage(),
                                                    parserError.getRow() ) );
            } else if ( error instanceof FunctionError ) {
                FunctionError functionError = (FunctionError) error;
                // TODO add line to function error
                // TODO try to retrieve character start-end
                if ( functionError.getObject() instanceof CompilationProblem[] ) {
View Full Code Here

Examples of org.drools.compiler.ParserError

                      parser.getErrors().size() );
        parser.parse( new InputStreamReader( getClass().getResourceAsStream( "errors_parser_multiple.drl" ) ) );
        assertTrue( parser.hasErrors() );
        assertTrue( parser.getErrors().size() > 0 );
        assertTrue( parser.getErrors().get( 0 ) instanceof ParserError );
        final ParserError first = ((ParserError) parser.getErrors().get( 0 ));
        assertTrue( first.getMessage() != null );
        assertFalse( first.getMessage().equals( "" ) );
    }
View Full Code Here

Examples of org.drools.compiler.ParserError

    public static final int MISC=33;

        private List<ParserError> errors = new ArrayList<ParserError>();

        public void reportError(RecognitionException ex) {
            errors.add(new ParserError( "DSL lexer error", ex.line, ex.charPositionInLine ) );
        }
View Full Code Here

Examples of org.drools.compiler.ParserError


        private List<ParserError> errors = new ArrayList<ParserError>();

        public void reportError(RecognitionException ex) {
            errors.add(new ParserError( "DSL parser error", ex.line, ex.charPositionInLine ) );
        }
View Full Code Here

Examples of org.drools.compiler.ParserError

        private static final Pattern namePat = Pattern.compile( "[\\p{L}_$][\\p{L}_$\\d]*" );

        private void isIdentifier( Token name ){
            String nameString = name.getText();
            if( ! namePat.matcher( nameString ).matches() ){
                errors.add(new ParserError( "invalid variable identifier " + nameString,
                                            name.getLine(), name.getCharPositionInLine() ) );
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.