FileDocCategorySizeDatePackage
DocumentBuilderSetting.javaAPI DocAndroid 1.5 API7463Wed May 06 22:41:06 BST 2009tests.org.w3c.dom

DocumentBuilderSetting

public final class DocumentBuilderSetting extends Object
This class is an parser setting, such as non-validating or entity-expanding.
author
Curt Arnold @date 2 Feb 2002

Fields Summary
private final String
property
property name.
private final boolean
value
property value.
private final DocumentBuilderSettingStrategy
strategy
strategy used to set or get property value.
public static final DocumentBuilderSetting
coalescing
coalescing = true.
public static final DocumentBuilderSetting
notCoalescing
coalescing = false.
public static final DocumentBuilderSetting
expandEntityReferences
expandEntityReferences = false.
public static final DocumentBuilderSetting
notExpandEntityReferences
expandEntityReferences = true.
public static final DocumentBuilderSetting
ignoringElementContentWhitespace
ignoringElementContentWhitespace = true.
public static final DocumentBuilderSetting
notIgnoringElementContentWhitespace
ignoringElementContentWhitespace = false.
public static final DocumentBuilderSetting
namespaceAware
namespaceAware = true.
public static final DocumentBuilderSetting
notNamespaceAware
namespaceAware = false.
public static final DocumentBuilderSetting
validating
validating = true.
public static final DocumentBuilderSetting
notValidating
validating = false.
public static final DocumentBuilderSetting
signed
signed = true.
public static final DocumentBuilderSetting
notSigned
signed = false.
public static final DocumentBuilderSetting
hasNullString
hasNullString = true.
public static final DocumentBuilderSetting
notHasNullString
hasNullString = false.
public static final DocumentBuilderSetting
schemaValidating
Schema validating enabled.
public static final DocumentBuilderSetting
notSchemaValidating
Schema validating disabled.
public static final DocumentBuilderSetting
ignoringComments
Comments ignored.
public static final DocumentBuilderSetting
notIgnoringComments
Comments preserved.
Constructors Summary
protected DocumentBuilderSetting(String property, boolean value, DocumentBuilderSettingStrategy strategy)
Protected constructor, use static members for supported settings.

param
property property name, follows JAXP.
param
value property value
param
strategy strategy, may not be null


                              
   
       
       
        
    if (property == null) {
      throw new NullPointerException("property");
    }
    this.property = property;
    this.value = value;
    this.strategy = strategy;
  
Methods Summary
public final voidapplySetting(javax.xml.parsers.DocumentBuilderFactory factory)
Attempts to change builder to have this setting.

param
factory DocumentBuilderFactory Factory for DOM builders
throws
DOMTestIncompatibleException if factory does not support the setting

    strategy.applySetting(factory, value);
  
public final java.lang.StringgetProperty()
Gets the property name.

return
property name

    return property;
  
public final booleangetValue()
Gets the property value.

return
property value

    return value;
  
public final booleanhasConflict(tests.org.w3c.dom.DocumentBuilderSetting other)
Returns true if the settings have a conflict or are identical.

param
other other setting, may not be null.
return
true if this setting and the specified setting conflict

    if (other == null) {
      throw new NullPointerException("other");
    }
    if (other == this) {
      return true;
    }
    return strategy.hasConflict(other.strategy);
  
public final booleanhasSetting(DOMDocumentBuilderFactory factory)
Determines current value of setting.

param
factory DOMTestDocumentBuilderFactory factory
return
boolean true if property enabled.

    return strategy.hasSetting(factory) == value;
 
public final java.lang.StringtoString()
Gets a string representation of the setting.

return
string representation

    StringBuffer builder = new StringBuffer(property);
    builder.append('=");
    builder.append(String.valueOf(value));
    return builder.toString();