本文整理汇总了Java中org.w3c.css.sac.Locator类的典型用法代码示例。如果您正苦于以下问题:Java Locator类的具体用法?Java Locator怎么用?Java Locator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Locator类属于org.w3c.css.sac包,在下文中一共展示了Locator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _class
import org.w3c.css.sac.Locator; //导入依赖的package包/类
final public Condition _class(Condition pred) throws ParseException {
Token t;
Locator locator;
try {
jj_consume_token(DOT);
locator = createLocator(token);
t = jj_consume_token(IDENT);
Condition c = getConditionFactory().createClassCondition(null, t.image);
if (c instanceof Locatable) {
((Locatable) c).setLocator(locator);
}
return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c);
} catch (ParseException e) {
throw toCSSParseException("invalidClassSelector", e);
}
}
示例2: _class
import org.w3c.css.sac.Locator; //导入依赖的package包/类
final public Condition _class(Condition pred, boolean pseudoElementFound) throws ParseException {
Token t;
Locator locator;
ParseException pe = null;
try {
if (pseudoElementFound) {
pe = generateParseException();
}
jj_consume_token(DOT);
locator = createLocator(token);
t = jj_consume_token(IDENT);
if (pseudoElementFound) {
throw pe;
}
Condition c = getConditionFactory().createClassCondition(null, unescape(t.image, false));
if (c instanceof Locatable) {
((Locatable) c).setLocator(locator);
}
return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c);
} catch (ParseException e) {
throw toCSSParseException("invalidClassSelector", e);
}
}
示例3: _class
import org.w3c.css.sac.Locator; //导入依赖的package包/类
final public Condition _class(Condition pred) throws ParseException {
Token t;
Locator locator;
try {
jj_consume_token(DOT);
locator = this.createLocator(token);
t = jj_consume_token(IDENT);
Condition c = this.getConditionFactory().createClassCondition(null, t.image);
if (c instanceof Locatable) {
((Locatable) c).setLocator(locator);
}
return (pred == null) ? c : this.getConditionFactory().createAndCondition(pred, c);
} catch (ParseException e) {
throw this.toCSSParseException("invalidClassSelector", e);
}
}
示例4: _class
import org.w3c.css.sac.Locator; //导入依赖的package包/类
final public Condition _class(Condition pred, boolean pseudoElementFound) throws ParseException {
Token t;
Locator locator;
ParseException pe = null;
try {
if (pseudoElementFound) {
pe = generateParseException();
}
jj_consume_token(DOT);
locator = createLocator(token);
t = jj_consume_token(IDENT);
if (pseudoElementFound) {
throw pe;
}
Condition c = getConditionFactory().createClassCondition(null, t.image);
if (c instanceof Locatable) {
((Locatable) c).setLocator(locator);
}
return (pred == null) ? c : getConditionFactory().createAndCondition(pred, c);
} catch (ParseException e) {
throw toCSSParseException("invalidClassSelector", e);
}
}
示例5: startMedia
import org.w3c.css.sac.Locator; //导入依赖的package包/类
@Override
public void startMedia(final SACMediaList media, final Locator locator) throws CSSException {
final MediaListImpl ml = new MediaListImpl(media);
// Create the media rule and add it to the rule list
final CSSMediaRuleImpl mr = new CSSMediaRuleImpl(CSSOMParser.this.getParentStyleSheet(), getParentRule(),
ml);
addLocator(locator, mr);
if (!nodeStack_.empty()) {
((CSSRuleListImpl) nodeStack_.peek()).add(mr);
}
// Create the rule list
final CSSRuleListImpl rules = new CSSRuleListImpl();
mr.setRuleList(rules);
nodeStack_.push(mr);
nodeStack_.push(rules);
}
示例6: startPage
import org.w3c.css.sac.Locator; //导入依赖的package包/类
@Override
public void startPage(final String name, final String pseudoPage, final Locator locator) throws CSSException {
// Create the page rule and add it to the rule list
final CSSPageRuleImpl pr = new CSSPageRuleImpl(CSSOMParser.this.getParentStyleSheet(), getParentRule(),
pseudoPage);
addLocator(locator, pr);
if (!nodeStack_.empty()) {
((CSSRuleListImpl) nodeStack_.peek()).add(pr);
}
// Create the style declaration
final CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(pr);
pr.setStyle(decl);
nodeStack_.push(pr);
nodeStack_.push(decl);
}
示例7: startFontFace
import org.w3c.css.sac.Locator; //导入依赖的package包/类
@Override
public void startFontFace(final Locator locator) throws CSSException {
// Create the font face rule and add it to the rule list
final CSSFontFaceRuleImpl ffr = new CSSFontFaceRuleImpl(CSSOMParser.this.getParentStyleSheet(),
getParentRule());
addLocator(locator, ffr);
if (!nodeStack_.empty()) {
((CSSRuleListImpl) nodeStack_.peek()).add(ffr);
}
// Create the style declaration
final CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(ffr);
ffr.setStyle(decl);
nodeStack_.push(ffr);
nodeStack_.push(decl);
}
示例8: startSelector
import org.w3c.css.sac.Locator; //导入依赖的package包/类
@Override
public void startSelector(final SelectorList selectors, final Locator locator) throws CSSException {
// Create the style rule and add it to the rule list
final CSSStyleRuleImpl sr = new CSSStyleRuleImpl(CSSOMParser.this.getParentStyleSheet(), getParentRule(),
selectors);
addLocator(locator, sr);
if (!nodeStack_.empty()) {
final Object o = nodeStack_.peek();
((CSSRuleListImpl) o).add(sr);
}
// Create the style declaration
final CSSStyleDeclarationImpl decl = new CSSStyleDeclarationImpl(sr);
sr.setStyle(decl);
nodeStack_.push(sr);
nodeStack_.push(decl);
}
示例9: equals
import org.w3c.css.sac.Locator; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Locator)) {
return false;
}
final Locator l = (Locator) obj;
return (getColumnNumber() == l.getColumnNumber()) && (getLineNumber() == l.getLineNumber())
&& LangUtils.equals(getURI(), l.getURI());
}
示例10: unknownAtRule
import org.w3c.css.sac.Locator; //导入依赖的package包/类
final public void unknownAtRule() throws ParseException {
String s;
Locator locator;
try {
jj_consume_token(ATKEYWORD);
locator = createLocator(token);
s = skip();
handleIgnorableAtRule(s, locator);
} catch (ParseException e) {
getErrorHandler().error(toCSSParseException("invalidUnknownRule", e));
}
}
示例11: handleIgnorableAtRule
import org.w3c.css.sac.Locator; //导入依赖的package包/类
protected void handleIgnorableAtRule(final String s, final Locator locator) {
final DocumentHandler documentHandler = getDocumentHandler();
if (documentHandler instanceof DocumentHandlerExt) {
((DocumentHandlerExt) documentHandler).ignorableAtRule(s, locator);
} else {
documentHandler.ignorableAtRule(s);
}
}
示例12: handleImportStyle
import org.w3c.css.sac.Locator; //导入依赖的package包/类
protected void handleImportStyle(final String uri, final SACMediaList media, final String defaultNamespaceURI,
final Locator locator) {
final DocumentHandler documentHandler = getDocumentHandler();
if (documentHandler instanceof DocumentHandlerExt) {
((DocumentHandlerExt) documentHandler).importStyle(uri, media, defaultNamespaceURI, locator);
} else {
documentHandler.importStyle(uri, media, defaultNamespaceURI);
}
}
示例13: handleStartMedia
import org.w3c.css.sac.Locator; //导入依赖的package包/类
protected void handleStartMedia(final SACMediaList media, final Locator locator) {
final DocumentHandler documentHandler = getDocumentHandler();
if (documentHandler instanceof DocumentHandlerExt) {
((DocumentHandlerExt) documentHandler).startMedia(media, locator);
} else {
documentHandler.startMedia(media);
}
}
示例14: handleStartPage
import org.w3c.css.sac.Locator; //导入依赖的package包/类
protected void handleStartPage(final String name, final String pseudoPage, final Locator locator) {
final DocumentHandler documentHandler = getDocumentHandler();
if (documentHandler instanceof DocumentHandlerExt) {
((DocumentHandlerExt) documentHandler).startPage(name, pseudoPage, locator);
} else {
documentHandler.startPage(name, pseudoPage);
}
}
示例15: handleStartFontFace
import org.w3c.css.sac.Locator; //导入依赖的package包/类
protected void handleStartFontFace(final Locator locator) {
final DocumentHandler documentHandler = getDocumentHandler();
if (documentHandler instanceof DocumentHandlerExt) {
((DocumentHandlerExt) documentHandler).startFontFace(locator);
} else {
documentHandler.startFontFace();
}
}