ImageVerifierCode 换一换
你正在下载:

代码4.docx

[预览]
格式:DOCX , 页数:97 ,大小:35.66KB ,
资源ID:5618229      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/5618229.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(代码4.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

代码4.docx

1、代码4package org.hibernate.c3p0.internal;package com.steadystate.css.parser;import com.steadystate.css.parser.selectors.ConditionFactoryImpl;import com.steadystate.css.parser.selectors.SelectorFactoryImpl;import com.steadystate.css.sac.DocumentHandlerExt;import java.io.IOException;import java.io.Input

2、StreamReader;import .URL;import java.nio.charset.Charset;import java.text.MessageFormat;import java.util.Locale;import java.util.MissingResourceException;import java.util.ResourceBundle;import org.w3c.css.sac.CSSParseException;import org.w3c.css.sac.ConditionFactory;import org.w3c.css.sac.DocumentHa

3、ndler;import org.w3c.css.sac.ErrorHandler;import org.w3c.css.sac.InputSource;import org.w3c.css.sac.LexicalUnit;import org.w3c.css.sac.Locator;import org.w3c.css.sac.Parser;import org.w3c.css.sac.SACMediaList;import org.w3c.css.sac.Selector;import org.w3c.css.sac.SelectorFactory;import org.w3c.css.s

4、ac.SelectorList;abstract class AbstractSACParser implements Parser private DocumentHandler documentHandler_; private ErrorHandler errorHandler_; private InputSource source_; private Locale locale_; private SelectorFactory selectorFactory_; private ConditionFactory conditionFactory_; private Resource

5、Bundle sacParserMessages_; private static final String NUM_CHARS = 0123456789.; protected abstract Token getToken(); protected DocumentHandler getDocumentHandler() if (this.documentHandler_ = null) setDocumentHandler(new HandlerBase(); return this.documentHandler_; public void setDocumentHandler(Doc

6、umentHandler handler) this.documentHandler_ = handler; protected ErrorHandler getErrorHandler() if (this.errorHandler_ = null) setErrorHandler(new HandlerBase(); return this.errorHandler_; public void setErrorHandler(ErrorHandler eh) this.errorHandler_ = eh; protected InputSource getInputSource() re

7、turn this.source_; public void setLocale(Locale locale) if (this.locale_ != locale) this.sacParserMessages_ = null; this.locale_ = locale; protected Locale getLocale() if (this.locale_ = null) setLocale(Locale.getDefault(); return this.locale_; protected SelectorFactory getSelectorFactory() if (this

8、.selectorFactory_ = null) this.selectorFactory_ = new SelectorFactoryImpl(); return this.selectorFactory_; public void setSelectorFactory(SelectorFactory selectorFactory) this.selectorFactory_ = selectorFactory; protected ConditionFactory getConditionFactory() if (this.conditionFactory_ = null) this

9、.conditionFactory_ = new ConditionFactoryImpl(); return this.conditionFactory_; public void setConditionFactory(ConditionFactory conditionFactory) this.conditionFactory_ = conditionFactory; protected ResourceBundle getSACParserMessages() if (this.sacParserMessages_ = null) try this.sacParserMessages

10、_ = ResourceBundle.getBundle(com.steadystate.css.parser.SACParserMessages, getLocale(); catch (MissingResourceException e) e.printStackTrace(); return this.sacParserMessages_; public Locator getLocator() return createLocator(getToken(); protected Locator createLocator(Token t) return new LocatorImpl

11、(getInputSource().getURI(), t = null ? 0 : t.beginLine, t = null ? 0 : t.beginColumn); protected String add_escapes(String str) StringBuilder sb = new StringBuilder(); if (ch ) String s = 0000 + Integer.toString(ch, 16); sb.append(u + s.substring(s.length() - 4, s.length(); else sb.append(ch); break

12、; return sb.toString(); protected CSSParseException toCSSParseException(String key, ParseException e) String messagePattern1 = getSACParserMessages().getString(invalidExpectingOne); String messagePattern2 = getSACParserMessages().getString(invalidExpectingMore); int maxSize = 0; StringBuilder expect

13、ed = new StringBuilder(); for (int i = 0; i e.expectedTokenSequences.length; i+) if (maxSize e.expectedTokenSequencesi.length) maxSize = e.expectedTokenSequencesi.length; for (int j = 0; j e.expectedTokenSequencesi.length; j+) expected.append(e.tokenImagee.expectedTokenSequencesij); if (i e.expected

14、TokenSequences.length - 1) expected.append(, ); StringBuilder invalid = new StringBuilder(); Token tok = e.currentToken.next; for (int i = 0; i maxSize; i+) if (i != 0) invalid.append( ); if (tok.kind = 0) invalid.append(e.tokenImage0); break; invalid.append(add_escapes(tok.image); tok = tok.next; S

15、tring s = null; try s = getSACParserMessages().getString(key); catch (MissingResourceException ex) s = key; StringBuilder message = new StringBuilder(s); message.append( (); if (e.expectedTokenSequences.length = 1) message.append(MessageFormat.format(messagePattern1, new Object invalid, expected );

16、else message.append(MessageFormat.format(messagePattern2, new Object invalid, expected ); message.append(); return new CSSParseException(message.toString(), getInputSource().getURI(), e.currentToken.next.beginLine, e.currentToken.next.beginColumn); protected CSSParseException toCSSParseException(Tok

17、enMgrError e) String messagePattern = getSACParserMessages().getString(tokenMgrError); return new CSSParseException(messagePattern, getInputSource().getURI(), 1, 1); protected CSSParseException toCSSParseException(String messageKey, Object msgParams, Locator locator) String messagePattern = getSACPa

18、rserMessages().getString(messageKey); return new CSSParseException(MessageFormat.format(messagePattern, msgParams), locator); protected CSSParseException createSkipWarning(String key, CSSParseException e) String s = null; try s = getSACParserMessages().getString(key); catch (MissingResourceException

19、 ex) s = key; return new CSSParseException(s, e.getURI(), e.getLineNumber(), e.getColumnNumber(); public void parseStyleSheet(InputSource source) throws IOException this.source_ = source; ReInit(getCharStream(source); try styleSheet(); catch (ParseException e) getErrorHandler().error(toCSSParseExcep

20、tion(invalidStyleSheet, e); catch (TokenMgrError e) getErrorHandler().error(toCSSParseException(e); catch (CSSParseException e) getErrorHandler().error(e); public void parseStyleSheet(String uri) throws IOException parseStyleSheet(new InputSource(uri); public void parseStyleDeclaration(InputSource s

21、ource) throws IOException this.source_ = source; ReInit(getCharStream(source); try styleDeclaration(); catch (ParseException e) getErrorHandler().error(toCSSParseException(invalidStyleDeclaration, e); catch (TokenMgrError e) getErrorHandler().error(toCSSParseException(e); catch (CSSParseException e)

22、 getErrorHandler().error(e); public void parseRule(InputSource source) throws IOException this.source_ = source; ReInit(getCharStream(source); try styleSheetRuleSingle(); catch (ParseException e) getErrorHandler().error(toCSSParseException(invalidRule, e); catch (TokenMgrError e) getErrorHandler().e

23、rror(toCSSParseException(e); catch (CSSParseException e) getErrorHandler().error(e); public SelectorList parseSelectors(InputSource source) throws IOException this.source_ = source; ReInit(getCharStream(source); SelectorList sl = null; try sl = parseSelectorsInternal(); catch (ParseException e) getE

24、rrorHandler().error(toCSSParseException(invalidSelectorList, e); catch (TokenMgrError e) getErrorHandler().error(toCSSParseException(e); catch (CSSParseException e) getErrorHandler().error(e); return sl; public LexicalUnit parsePropertyValue(InputSource source) throws IOException this.source_ = sour

25、ce; ReInit(getCharStream(source); LexicalUnit lu = null; try lu = expr(); catch (ParseException e) getErrorHandler().error(toCSSParseException(invalidExpr, e); catch (TokenMgrError e) getErrorHandler().error(toCSSParseException(e); catch (CSSParseException e) getErrorHandler().error(e); return lu; p

26、ublic boolean parsePriority(InputSource source) throws IOException this.source_ = source; ReInit(getCharStream(source); boolean b = false; try b = prio(); catch (ParseException e) getErrorHandler().error(toCSSParseException(invalidPrio, e); catch (TokenMgrError e) getErrorHandler().error(toCSSParseE

27、xception(e); catch (CSSParseException e) getErrorHandler().error(e); return b; public SACMediaList parseMedia(InputSource source) throws IOException this.source_ = source; ReInit(getCharStream(source); SACMediaListImpl ml = new SACMediaListImpl(); try mediaList(ml); catch (ParseException e) getError

28、Handler().error(toCSSParseException(invalidMediaList, e); catch (TokenMgrError e) getErrorHandler().error(toCSSParseException(e); catch (CSSParseException e) getErrorHandler().error(e); return ml; private CharStream getCharStream(InputSource source) throws IOException if (source.getCharacterStream()

29、 != null) return new CssCharStream(source.getCharacterStream(), 1, 1); if (source.getByteStream() != null) String encoding = source.getEncoding(); InputStreamReader reader; InputStreamReader reader; if (encoding = null) | (encoding.length() 1) reader = new InputStreamReader(source.getByteStream(), Charset.defaultCharset(); else reader = new InputStreamReader(source.getByteStream(), encoding); return new CssCharStream(reader, 1, 1); if (

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1