下面列出了怎么用org.xml.sax.ext.DeclHandler的API类实例代码及写法,或者点击链接到github查看源代码。
public DocTypeTextLexicalHandler(DeclHandler dh) throws SAXException {
// this.dh = dh;
xmlReader = XMLReaderFactory.createXMLReader();
// xmlReader.setProperty(
// "http://xml.org/sax/properties/lexical-handler",
// lh);
// DTD
xmlReader.setFeature(
"http://xml.org/sax/features/resolve-dtd-uris", false);
// *skip* resolving entities like DTDs
xmlReader.setEntityResolver(new NoEntityResolver());
xmlReader.setProperty(
"http://xml.org/sax/properties/declaration-handler", dh);
}
protected boolean _setProperty(String name, Object value) throws SAXNotSupportedException{
if(LEXICAL_HANDLER.equals(name) || LEXICAL_HANDLER_ALT.equals(name)){
if(value==null || value instanceof LexicalHandler){
handler.setLexicalHandler((LexicalHandler)value);
return true;
}else
throw new SAXNotSupportedException("value must implement "+LexicalHandler.class);
}else if(DECL_HANDLER.equals(name) || DECL_HANDLER_ALT.equals(name)){
if(value==null || value instanceof DeclHandler){
handler.setDeclHandler((DeclHandler)value);
return true;
}else
throw new SAXNotSupportedException("value must implement "+DeclHandler.class);
}else
return false;
}
/**
* Test to set and get the declaration-handler.
*
* @param saxparser a SAXParser instance.
* @throws SAXException If any parse errors occur.
*/
@Test(dataProvider = "parser-provider")
public void testProperty06(SAXParser saxparser) throws SAXException {
MyDeclHandler myDeclHandler = new MyDeclHandler();
saxparser.setProperty(DECL_HANDLER, myDeclHandler);
assertTrue(saxparser.getProperty(DECL_HANDLER) instanceof DeclHandler);
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if ("http://xml.org/sax/properties/lexical-handler".equals(name)) {
this.lexicalHandler = (LexicalHandler) value;
} else if ("http://xml.org/sax/properties/declaration-handler"
.equals(name)) {
this.declHandler = (DeclHandler) value;
} else {
throw new SAXNotRecognizedException(name);
}
}
/**
* Registers given handler with all its implementing interfaces.
* This would be handy if you want to register to all interfaces
* implemented by given handler object
*
* @param handler Object implementing one or more sax handler interfaces
*/
public void setHandler(Object handler){
if(handler instanceof ContentHandler)
setContentHandler((ContentHandler)handler);
if(handler instanceof EntityResolver)
setEntityResolver((EntityResolver)handler);
if(handler instanceof ErrorHandler)
setErrorHandler((ErrorHandler)handler);
if(handler instanceof DTDHandler)
setDTDHandler((DTDHandler)handler);
if(handler instanceof LexicalHandler)
setLexicalHandler((LexicalHandler)handler);
if(handler instanceof DeclHandler)
setDeclHandler((DeclHandler)handler);
}
@Override
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException{
if(LEXICAL_HANDLER.equals(name) || LEXICAL_HANDLER_ALT.equals(name)){
if(value==null || value instanceof LexicalHandler)
lexicalHandler = (LexicalHandler)value;
else
throw new SAXNotSupportedException("value must implement "+LexicalHandler.class);
}else if(DECL_HANDLER.equals(name) || DECL_HANDLER_ALT.equals(name)){
if(value==null || value instanceof DeclHandler)
declHandler = (DeclHandler)value;
else
throw new SAXNotSupportedException("value must implement "+DeclHandler.class);
}else
throw new SAXNotRecognizedException();
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}
public void setDeclHandler(DeclHandler handler) {
_declHandler = handler;
}
public DeclHandler getDeclHandler() {
return _declHandler;
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}
public void setDeclHandler(DeclHandler handler) {
_declHandler = handler;
}
public DeclHandler getDeclHandler() {
return _declHandler;
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}
public void setDeclHandler(DeclHandler handler) {
_declHandler = handler;
}
public DeclHandler getDeclHandler() {
return _declHandler;
}
public static void setDeclarationHandler (@Nullable final DeclHandler aDeclHandler)
{
setPropertyValue (EXMLParserProperty.SAX_DECLARATION_HANDLER, aDeclHandler);
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}
public void setDeclHandler(DeclHandler handler) {
_declHandler = handler;
}
public DeclHandler getDeclHandler() {
return _declHandler;
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}
public void setDeclHandler(DeclHandler handler) {
_declHandler = handler;
}
public DeclHandler getDeclHandler() {
return _declHandler;
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}
public void setDeclHandler(DeclHandler handler) {
_declHandler = handler;
}
public DeclHandler getDeclHandler() {
return _declHandler;
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}
public void setDeclHandler(DeclHandler handler) {
_declHandler = handler;
}
public DeclHandler getDeclHandler() {
return _declHandler;
}
@Nonnull
public final SAXReaderSettings setDeclarationHandler (@Nullable final DeclHandler aDeclHandler)
{
return setPropertyValue (EXMLParserProperty.SAX_DECLARATION_HANDLER, aDeclHandler);
}
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name.equals(Properties.LEXICAL_HANDLER_PROPERTY)) {
if (value instanceof LexicalHandler) {
setLexicalHandler((LexicalHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(Properties.DTD_DECLARATION_HANDLER_PROPERTY)) {
if (value instanceof DeclHandler) {
setDeclHandler((DeclHandler)value);
} else {
throw new SAXNotSupportedException(Properties.LEXICAL_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY)) {
if (value instanceof Map) {
setExternalVocabularies((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.EXTERNAL_VOCABULARIES_PROPERTY);
}
} else if (name.equals(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY)) {
if (value instanceof Map) {
setRegisteredEncodingAlgorithms((Map)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.REGISTERED_ENCODING_ALGORITHMS_PROPERTY);
}
} else if (name.equals(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof EncodingAlgorithmContentHandler) {
setEncodingAlgorithmContentHandler((EncodingAlgorithmContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY)) {
if (value instanceof PrimitiveTypeContentHandler) {
setPrimitiveTypeContentHandler((PrimitiveTypeContentHandler)value);
} else {
throw new SAXNotSupportedException(FastInfosetReader.PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY);
}
} else if (name.equals(FastInfosetReader.BUFFER_SIZE_PROPERTY)) {
if (value instanceof Integer) {
setBufferSize(((Integer)value).intValue());
} else {
throw new SAXNotSupportedException(FastInfosetReader.BUFFER_SIZE_PROPERTY);
}
} else {
throw new SAXNotRecognizedException(CommonResourceBundle.getInstance().
getString("message.propertyNotRecognized", new Object[]{name}));
}
}