public abstract class AbstractSecureSAXParser
extends org.apache.xerces.parsers.SAXParser
サブクラスはCastorで利用することを前提としている。
サブクラスはインスタンス生成時にセキュアモードとなり、
setEntityResolver実行時に、EntityResolverを判断材料として、通常モードに戻すことができる。
サブクラスでは、
・セキュアモードへの移行
・通常モードへの移行
・通常モードに戻すか否かの判断
の実装が必要。
NOTIFY_BUILTIN_REFS, SYMBOL_TABLE, XMLGRAMMAR_POOL
ALLOW_UE_AND_NOTATION_EVENTS, DECLARATION_HANDLER, DOM_NODE, fContentHandler, fDeclaredAttrs, fDeclHandler, fDocumentHandler, fDTDHandler, fLexicalHandler, fLexicalHandlerParameterEntities, fNamespaceContext, fNamespacePrefixes, fNamespaces, fParseInProgress, fQName, fResolveDTDURIs, fStandalone, fUseEntityResolver2, fVersion, fXMLNSURIs, LEXICAL_HANDLER, NAMESPACES, STRING_INTERNING
コンストラクタと説明 |
---|
AbstractSecureSAXParser()
コンストラクタ。
|
修飾子とタイプ | メソッドと説明 |
---|---|
protected void |
backupNormalSetting()
初期値が不明な設定をバックアップするための拡張ポイント。
|
protected abstract boolean |
needNotSecureMode(EntityResolver resolver)
セキュアモードである必要が無い場合にtrueを返却する。
|
void |
setEntityResolver(EntityResolver resolver)
EntityResolverを設定する。
|
protected abstract void |
toNormalMode()
通常モードに移行する。
|
protected abstract void |
toSecureMode()
セキュアモードに移行する。
|
attributeDecl, characters, comment, doctypeDecl, elementDecl, endCDATA, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endNamespaceMapping, endParameterEntity, externalEntityDecl, getAttributePSVI, getAttributePSVIByName, getContentHandler, getDeclHandler, getDTDHandler, getElementPSVI, getEntityResolver, getErrorHandler, getFeature, getLexicalHandler, getProperty, ignorableWhitespace, internalEntityDecl, notationDecl, parse, parse, processingInstruction, reset, setContentHandler, setDeclHandler, setDocumentHandler, setDTDHandler, setErrorHandler, setFeature, setLexicalHandler, setLocale, setProperty, startCDATA, startDocument, startElement, startExternalSubset, startGeneralEntity, startNamespaceMapping, startParameterEntity, unparsedEntityDecl, xmlDecl
any, element, empty, emptyElement, endAttlist, endConditional, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, ignoredCharacters, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startAttlist, startConditional, startContentModel, startDTD, startGroup, textDecl
public AbstractSecureSAXParser() throws SAXException
セキュアモードに移行する。
SAXException
- パーサが対応していない設定を行った場合等(使用するXercesに合わせてサブクラスが作られている限り、この例外は発生しない。)public void setEntityResolver(EntityResolver resolver)
EntityResolverを設定する際、EntityResolverを確認し、セキュアモードである必要が無ければ、通常モードに戻す。
setEntityResolver
インタフェース内 Parser
setEntityResolver
インタフェース内 XMLReader
setEntityResolver
クラス内 org.apache.xerces.parsers.AbstractSAXParser
AbstractSAXParser.setEntityResolver(org.xml.sax.EntityResolver)
protected void backupNormalSetting() throws SAXException
SAXException
- パーサが対応していない設定を行った場合等(使用するXercesに合わせてサブクラスが作られている限り、この例外は発生しない。)protected abstract boolean needNotSecureMode(EntityResolver resolver)
resolver
- EntityResolverprotected abstract void toSecureMode() throws SAXException
SAXException
- パーサが対応していない設定を行った場合等(使用するXercesに合わせてサブクラスが作られている限り、この例外は発生しない。)protected abstract void toNormalMode() throws SAXException
SAXException
- パーサが対応していない設定を行った場合等(使用するXercesに合わせてサブクラスが作られている限り、この例外は発生しない。)Copyright © 2015. All Rights Reserved.