org.apache.abdera.parser
Interface ParserOptions

All Superinterfaces:
Cloneable

public interface ParserOptions
extends Cloneable

Parser options are used to modify the behavior of the parser.


Method Summary
 Object clone()
           
 boolean getAutodetectCharset()
          Returns true if the parser should attempt to automatically detect the character encoding from the stream
 String getCharset()
          Returns the default character set to use for the parsed document
 CompressionUtil.CompressionCodec[] getCompressionCodecs()
          When parsing an InputStream that contains compressed data, use these codecs to decompress the stream.
 Factory getFactory()
          Returns the factory the parser should use
 char getFilterRestrictedCharacterReplacement()
          If getFilterRestrictedCharacters is true, restricted characters will be replaced with the specified character
 boolean getFilterRestrictedCharacters()
          If true, the parser will attempt to silently filter out invalid XML characters appearing within the XML document.
 boolean getMustPreserveWhitespace()
          If false, the parser will trim leading and trailing whitespace in element and attribute values unless there is an in-scope xml:space="preserve".
 ParseFilter getParseFilter()
          Returns the Parse Filter.
 Map<QName,QName> getQNameAliasMap()
          Get the QName-Alias Mapping (default null)
 boolean getResolveEntities()
          True if undeclared named entities should be resolved.
 boolean isQNameAliasMappingEnabled()
          True if QName-Alias mapping is enabled (default is false)
 ParserOptions registerEntity(String name, String value)
          Register a named entity.
 String resolveEntity(String name)
          Resolves a value for a named entity.
 ParserOptions setAutodetectCharset(boolean detect)
          If true, the parser will attempt to automatically detect the character encoding from the stream by checking for the byte order mark or checking the XML prolog.
 ParserOptions setCharset(String charset)
          Sets the character set to use for the parsed document
 ParserOptions setCompressionCodecs(CompressionUtil.CompressionCodec... codecs)
          When parsing an InputStream that contains compressed data, use these codecs to decompress the stream.
 ParserOptions setFactory(Factory factory)
          Sets the factory the parser should use
 ParserOptions setFilterRestrictedCharacterReplacement(char replacement)
          If getFilterRestrictedCharacters is true, restricted characters will be replaced with the specified character
 ParserOptions setFilterRestrictedCharacters(boolean filter)
          If true, the parser will attempt to silently filter out invalid XML characters appearing within the XML document
 ParserOptions setMustPreserveWhitespace(boolean preserve)
          If false, the parser will trim leading and trailing whitespace in element and attribute values unless there is an in-scope xml:space="preserve".
 ParserOptions setParseFilter(ParseFilter parseFilter)
          Sets the Parse Filter.
 ParserOptions setQNameAliasMap(Map<QName,QName> map)
          Set the QName-Alias Mapping
 ParserOptions setQNameAliasMappingEnabled(boolean enabled)
          True if QName-Alias mapping is enabled
 ParserOptions setResolveEntities(boolean resolve)
          True if undeclared named entities should be resolved.
 

Method Detail

clone

Object clone()
             throws CloneNotSupportedException
Throws:
CloneNotSupportedException

getFactory

Factory getFactory()
Returns the factory the parser should use


setFactory

ParserOptions setFactory(Factory factory)
Sets the factory the parser should use


getCharset

String getCharset()
Returns the default character set to use for the parsed document


setCharset

ParserOptions setCharset(String charset)
Sets the character set to use for the parsed document


getParseFilter

ParseFilter getParseFilter()
Returns the Parse Filter. The parse filter is a set of XML QNames that the parse should watch out for. If the filter is null, the parser will parse all elements in the document. I the filter is not null, the parser will only pay attention to elements whose QName's appear in the filter list.


setParseFilter

ParserOptions setParseFilter(ParseFilter parseFilter)
Sets the Parse Filter. The parse filter is a set of XML QNames that the parse should watch out for. If the filter is null, the parser will parse all elements in the document. I the filter is not null, the parser will only pay attention to elements whose QName's appear in the filter list.


getAutodetectCharset

boolean getAutodetectCharset()
Returns true if the parser should attempt to automatically detect the character encoding from the stream


setAutodetectCharset

ParserOptions setAutodetectCharset(boolean detect)
If true, the parser will attempt to automatically detect the character encoding from the stream by checking for the byte order mark or checking the XML prolog.


getMustPreserveWhitespace

boolean getMustPreserveWhitespace()
If false, the parser will trim leading and trailing whitespace in element and attribute values unless there is an in-scope xml:space="preserve".


setMustPreserveWhitespace

ParserOptions setMustPreserveWhitespace(boolean preserve)
If false, the parser will trim leading and trailing whitespace in element and attribute values unless there is an in-scope xml:space="preserve".


getFilterRestrictedCharacters

boolean getFilterRestrictedCharacters()
If true, the parser will attempt to silently filter out invalid XML characters appearing within the XML document.


setFilterRestrictedCharacters

ParserOptions setFilterRestrictedCharacters(boolean filter)
If true, the parser will attempt to silently filter out invalid XML characters appearing within the XML document


getFilterRestrictedCharacterReplacement

char getFilterRestrictedCharacterReplacement()
If getFilterRestrictedCharacters is true, restricted characters will be replaced with the specified character


setFilterRestrictedCharacterReplacement

ParserOptions setFilterRestrictedCharacterReplacement(char replacement)
If getFilterRestrictedCharacters is true, restricted characters will be replaced with the specified character


getCompressionCodecs

CompressionUtil.CompressionCodec[] getCompressionCodecs()
When parsing an InputStream that contains compressed data, use these codecs to decompress the stream. Only used when parsing an InputStream. Ignored when parsing a Reader


setCompressionCodecs

ParserOptions setCompressionCodecs(CompressionUtil.CompressionCodec... codecs)
When parsing an InputStream that contains compressed data, use these codecs to decompress the stream. Only used when parsing an InputStream. Ignored when parsing a Reader


registerEntity

ParserOptions registerEntity(String name,
                             String value)
Register a named entity. This provides an escape clause for when feeds use entities that are not supported in XML without a DTD decl. By default, all of the (X)HTML entities are preregistered


resolveEntity

String resolveEntity(String name)
Resolves a value for a named entity. This provides an escape clause for when feeds use entities that are not supported in XML without a DTD decl. By default, all of the (X)HTML entities are preregistered


setResolveEntities

ParserOptions setResolveEntities(boolean resolve)
True if undeclared named entities should be resolved.


getResolveEntities

boolean getResolveEntities()
True if undeclared named entities should be resolved.


setQNameAliasMappingEnabled

ParserOptions setQNameAliasMappingEnabled(boolean enabled)
True if QName-Alias mapping is enabled


isQNameAliasMappingEnabled

boolean isQNameAliasMappingEnabled()
True if QName-Alias mapping is enabled (default is false)


getQNameAliasMap

Map<QName,QName> getQNameAliasMap()
Get the QName-Alias Mapping (default null)


setQNameAliasMap

ParserOptions setQNameAliasMap(Map<QName,QName> map)
Set the QName-Alias Mapping



Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.