public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; }
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } }
/** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error * curLexState : lexical state in which this error occured * errorLine : line number when the error occured * errorColumn : column number when the error occured * errorAfter : prefix that was seen before this error occured * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { return("Lexical error at line " + errorLine + ", column " + errorColumn + ". Encountered: " + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + "after : \"" + addEscapes(errorAfter) + "\""); }
/** * Parses the string representation of SCD. * * <p> * This method involves parsing the path expression and preparing the in-memory * structure, so this is useful when you plan to use the same SCD against * different context node multiple times. * * <p> * If you want to evaluate SCD just once, use {@link XSComponent#select} methods. * * @param path * the string representation of SCD, such as "/foo/bar". * @param nsContext * Its {@link NamespaceContext#getNamespaceURI(String)} is used * to resolve prefixes in the SCD to the namespace URI. */ public static SCD create(String path, NamespaceContext nsContext) throws java.text.ParseException { try { SCDParser p = new SCDParser(path,nsContext); List<?> list = p.RelativeSchemaComponentPath(); return new SCDImpl(path,list.toArray(new Step[list.size()])); } catch (TokenMgrError e) { throw setCause(new java.text.ParseException(e.getMessage(), -1 ),e); } catch (ParseException e) { throw setCause(new java.text.ParseException(e.getMessage(), e.currentToken.beginColumn ),e); } }
/** * Parses the string representation of SCD. * * <p> * This method involves parsing the path expression and preparing the in-memory * structure, so this is useful when you plan to use the same SCD against * different context node multiple times. * * <p> * If you want to evaluate SCD just once, use {@link XSComponent#select} methods. * * @param path * the string representation of SCD, such as "/foo/bar". * @param nsContext * Its {@link NamespaceContext#getNamespaceURI(String)} is used * to resolve prefixes in the SCD to the namespace URI. */ public static SCD create(String path, NamespaceContext nsContext) throws java.text.ParseException { try { SCDParser p = new SCDParser(path,nsContext); List<?> list = p.RelativeSchemaComponentPath(); return new SCDImpl(path,list.toArray(new Step[list.size()])); } catch (TokenMgrError e) { throw setCause(new java.text.ParseException(e.getMessage(), -1 ),e); } catch (ParseException e) { throw setCause(new java.text.ParseException(e.getMessage(), e.currentToken.beginColumn ),e); } }
public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; }
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } }
/** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error * curLexState : lexical state in which this error occured * errorLine : line number when the error occured * errorColumn : column number when the error occured * errorAfter : prefix that was seen before this error occured * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { return("Lexical error at line " + errorLine + ", column " + errorColumn + ". Encountered: " + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + "after : \"" + addEscapes(errorAfter) + "\""); }
/** * Parses the string representation of SCD. * * <p> * This method involves parsing the path expression and preparing the in-memory * structure, so this is useful when you plan to use the same SCD against * different context node multiple times. * * <p> * If you want to evaluate SCD just once, use {@link XSComponent#select} methods. * * @param path * the string representation of SCD, such as "/foo/bar". * @param nsContext * Its {@link NamespaceContext#getNamespaceURI(String)} is used * to resolve prefixes in the SCD to the namespace URI. */ public static SCD create(String path, NamespaceContext nsContext) throws java.text.ParseException { try { SCDParser p = new SCDParser(path,nsContext); List<?> list = p.RelativeSchemaComponentPath(); return new SCDImpl(path,list.toArray(new Step[list.size()])); } catch (TokenMgrError e) { throw setCause(new java.text.ParseException(e.getMessage(), -1 ),e); } catch (ParseException e) { throw setCause(new java.text.ParseException(e.getMessage(), e.currentToken.beginColumn ),e); } }
public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; }
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } }
/** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error * curLexState : lexical state in which this error occured * errorLine : line number when the error occured * errorColumn : column number when the error occured * errorAfter : prefix that was seen before this error occured * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { return("Lexical error at line " + errorLine + ", column " + errorColumn + ". Encountered: " + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + "after : \"" + addEscapes(errorAfter) + "\""); }
/** * Parses the string representation of SCD. * * <p> * This method involves parsing the path expression and preparing the in-memory * structure, so this is useful when you plan to use the same SCD against * different context node multiple times. * * <p> * If you want to evaluate SCD just once, use {@link XSComponent#select} methods. * * @param path * the string representation of SCD, such as "/foo/bar". * @param nsContext * Its {@link NamespaceContext#getNamespaceURI(String)} is used * to resolve prefixes in the SCD to the namespace URI. */ public static SCD create(String path, NamespaceContext nsContext) throws java.text.ParseException { try { SCDParser p = new SCDParser(path,nsContext); List<?> list = p.RelativeSchemaComponentPath(); return new SCDImpl(path,list.toArray(new Step[list.size()])); } catch (TokenMgrError e) { throw setCause(new java.text.ParseException(e.getMessage(), -1 ),e); } catch (ParseException e) { throw setCause(new java.text.ParseException(e.getMessage(), e.currentToken.beginColumn ),e); } }
public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; }
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } }
/** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error * curLexState : lexical state in which this error occured * errorLine : line number when the error occured * errorColumn : column number when the error occured * errorAfter : prefix that was seen before this error occured * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { return("Lexical error at line " + errorLine + ", column " + errorColumn + ". Encountered: " + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + "after : \"" + addEscapes(errorAfter) + "\""); }
/** * Parses the string representation of SCD. * * <p> * This method involves parsing the path expression and preparing the in-memory * structure, so this is useful when you plan to use the same SCD against * different context node multiple times. * * <p> * If you want to evaluate SCD just once, use {@link XSComponent#select} methods. * * @param path * the string representation of SCD, such as "/foo/bar". * @param nsContext * Its {@link NamespaceContext#getNamespaceURI(String)} is used * to resolve prefixes in the SCD to the namespace URI. */ public static SCD create(String path, NamespaceContext nsContext) throws java.text.ParseException { try { SCDParser p = new SCDParser(path,nsContext); List<?> list = p.RelativeSchemaComponentPath(); return new SCDImpl(path,list.toArray(new Step[list.size()])); } catch (TokenMgrError e) { throw setCause(new java.text.ParseException(e.getMessage(), -1 ),e); } catch (ParseException e) { throw setCause(new java.text.ParseException(e.getMessage(), e.currentToken.beginColumn ),e); } }
public void SwitchTo(int lexState) { if (lexState >= 1 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; }
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); } }
/** * Returns a detailed message for the Error when it is thrown by the * token manager to indicate a lexical error. * Parameters : * EOFSeen : indicates if EOF caused the lexicl error * curLexState : lexical state in which this error occured * errorLine : line number when the error occured * errorColumn : column number when the error occured * errorAfter : prefix that was seen before this error occured * curchar : the offending character * Note: You can customize the lexical error message by modifying this method. */ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { return("Lexical error at line " + errorLine + ", column " + errorColumn + ". Encountered: " + (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + "after : \"" + addEscapes(errorAfter) + "\""); }