/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a text attribute encoded in the given token. If the token's * data is not <code>null</code> and a text attribute it is assumed that * it is the encoded text attribute. It returns the default text attribute * if there is no encoded text attribute found. * * @param token the token whose text attribute is to be determined * @return the token's text attribute */ protected TextAttribute getTokenTextAttribute(IToken token) { Object data= token.getData(); if (data instanceof TextAttribute) return (TextAttribute) data; return fDefaultTextAttribute; }
/** * Returns a text attribute encoded in the given token. If the token's * data is not <code>null</code> and a text attribute it is assumed that * it is the encoded text attribute. It returns the default text attribute * if there is no encoded text attribute found. * * @param token the token whose text attribute is to be determined * @return the token's text attribute */ protected TextAttribute getTokenTextAttribute(IToken token) { Object data= token.getData(); if (data instanceof TextAttribute) return (TextAttribute) data; return fDefaultTextAttribute; }
/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * <p> * May be replaced or extended by subclasses. * </p> * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a text attribute encoded in the given token. If the token's * data is not <code>null</code> and a text attribute it is assumed that * it is the encoded text attribute. It returns the default text attribute * if there is no encoded text attribute found. * * @param token the token whose text attribute is to be determined * @return the token's text attribute */ protected TextAttribute getTokenTextAttribute(IToken token) { Object data= token.getData(); if (data instanceof TextAttribute) return (TextAttribute) data; return fDefaultTextAttribute; }
/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * <p> * May be replaced or extended by subclasses. * </p> * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * <p> * May be replaced or extended by subclasses. * </p> * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a content type encoded in the given token. If the token's * data is not <code>null</code> and a string it is assumed that * it is the encoded content type. * <p> * May be replaced or extended by subclasses. * </p> * * @param token the token whose content type is to be determined * @return the token's content type */ protected String getTokenContentType(IToken token) { Object data= token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Returns a content type encoded in the given token. If the token's data is not <code>null</code> and a string it * is assumed that it is the encoded content type. * <p> * May be replaced or extended by subclasses. * </p> * * @param token * the token whose content type is to be determined * @return the token's content type * @since 2.2 */ protected String getTokenContentType(IToken token) { Object data = token.getData(); if (data instanceof String) return (String) data; return null; }
/** * Configures the scanner's default return token. This is the token * which is returned when none of the rules fired and EOF has not been * reached. * * @param defaultReturnToken the default return token * @since 2.0 */ public void setDefaultReturnToken(IToken defaultReturnToken) { Assert.isNotNull(defaultReturnToken.getData()); fDefaultReturnToken= defaultReturnToken; }
/** * Configures the scanner's default return token. This is the token * which is returned when none of the rules fired and EOF has not been * reached. * * @param defaultReturnToken the default return token * @since 2.0 */ public void setDefaultReturnToken(IToken defaultReturnToken) { Assert.isNotNull(defaultReturnToken.getData()); fDefaultReturnToken= defaultReturnToken; }
/** * Configures the scanner's default return token. This is the token * which is returned when none of the rules fired and EOF has not been * reached. * * @param defaultReturnToken the default return token * @since 2.0 */ public void setDefaultReturnToken(IToken defaultReturnToken) { Assert.isNotNull(defaultReturnToken.getData()); fDefaultReturnToken= defaultReturnToken; }
/** * Configures the scanner's default return token. This is the token * which is returned when none of the rules fired and EOF has not been * reached. * * @param defaultReturnToken the default return token * @since 2.0 */ public void setDefaultReturnToken(IToken defaultReturnToken) { Assert.isNotNull(defaultReturnToken.getData()); fDefaultReturnToken= defaultReturnToken; }
/** * Returns a text attribute encoded in the given token. If the token's * data is not <code>null</code> and a text attribute it is assumed that * it is the encoded text attribute. It returns the default text attribute * if there is no encoded text attribute found. * * @param token the token whose text attribute is to be determined * @return the token's text attribute */ private TextAttribute getTokenTextAttribute(IToken token) { Object data= token.getData(); if(data instanceof TokenData) { return ((TokenData)data).getTextAttribute(); } return defaultTextAttribute; }
rule= (IPredicateRule) fRules[i]; token= rule.getSuccessToken(); if (fContentType.equals(token.getData())) { token= rule.evaluate(this, resume); if (!token.isUndefined()) {
rule= (IPredicateRule) fRules[i]; token= rule.getSuccessToken(); if (fContentType.equals(token.getData())) { token= rule.evaluate(this, resume); if (!token.isUndefined()) {
rule= (IPredicateRule) fRule; token= rule.getSuccessToken(); if (fContentType.equals(token.getData())) { token= rule.evaluate(this, resume); if (!token.isUndefined()) {