org.idoox.xml.schema
Class Facet.FixableFacet

java.lang.Object
  extended byorg.idoox.xml.schema.Facet
      extended byorg.idoox.xml.schema.Facet.FixableFacet
Direct Known Subclasses:
Facet.FractionDigits, Facet.Length, Facet.MaxExclusive, Facet.MaxInclusive, Facet.MaxLength, Facet.MinExclusive, Facet.MinInclusive, Facet.MinLength, Facet.TotalDigits, Facet.WhiteSpace
Enclosing class:
Facet

public abstract static class Facet.FixableFacet
extends Facet

A fixable facet is such a facet which supports the fixed attribute.


Nested Class Summary
 
Nested classes inherited from class org.idoox.xml.schema.Facet
Facet.Enumeration, Facet.FacetEnum, Facet.FixableFacet, Facet.FractionDigits, Facet.Length, Facet.MaxExclusive, Facet.MaxInclusive, Facet.MaxLength, Facet.MinExclusive, Facet.MinInclusive, Facet.MinLength, Facet.Pattern, Facet.TotalDigits, Facet.WhiteSpace
 
Field Summary
protected  boolean fixed
          whether the value if fixed - cannot be changed in descendants
 
Fields inherited from class org.idoox.xml.schema.Facet
name, value
 
Constructor Summary
protected Facet.FixableFacet(java.lang.String name, java.lang.String value, boolean fixed)
          Creates new instance of a fixable facet.
 
Method Summary
 boolean isFixed()
          Returns whether the given facet is fixed - its value cannot be changed in descendants.
 java.lang.String toString()
          Returns stringified representation of this facet.
protected  void writeInnerXMLContent(TokenWriter writer)
          This implementation writes the value of the fixed attribute and then calls a customizable routine writeInnerXMLContent2(org.idoox.xml.TokenWriter).
protected  void writeInnerXMLContent2(TokenWriter writer)
          Customizes the content of the enclosing xml tag representing the recent fixable facet.
 
Methods inherited from class org.idoox.xml.schema.Facet
equals, getName, getValue, hashCode, writeAsXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fixed

protected final boolean fixed
whether the value if fixed - cannot be changed in descendants

Constructor Detail

Facet.FixableFacet

protected Facet.FixableFacet(java.lang.String name,
                             java.lang.String value,
                             boolean fixed)
                      throws SchemaException
Creates new instance of a fixable facet. This is protected intentionally not to be able to create direct instances of this class, but to create derived classes.

Parameters:
name - name of the facet (identified its type)
value - value of the facet (constrains the value or lexical space of a type)
fixed - value of the fixed attribute
Throws:
SchemaException - if the validation of the given parameters fails (some attributes missing or have incorrect value)
Method Detail

isFixed

public boolean isFixed()
Returns whether the given facet is fixed - its value cannot be changed in descendants.

Returns:
true if attribute fixed is true, false otherwise

toString

public java.lang.String toString()
Returns stringified representation of this facet.

Overrides:
toString in class Facet

writeInnerXMLContent

protected final void writeInnerXMLContent(TokenWriter writer)
                                   throws java.io.IOException
This implementation writes the value of the fixed attribute and then calls a customizable routine writeInnerXMLContent2(org.idoox.xml.TokenWriter).

Overrides:
writeInnerXMLContent in class Facet
Parameters:
writer - writer to use when writing the xml content
Throws:
java.io.IOException - no comment

writeInnerXMLContent2

protected void writeInnerXMLContent2(TokenWriter writer)
                              throws java.io.IOException
Customizes the content of the enclosing xml tag representing the recent fixable facet. You can write attributes as well as some real content of the enclosing tag. The name of the enclosing tag is determined by the facet name - given at construction time.

This implementation is empty.

Parameters:
writer - writer to be used to write into the XML stream
Throws:
java.io.IOException - no comment