com.bea.schema
Class SOMRestriction

java.lang.Object
  extended bycom.bea.schema.SOMObject
      extended bycom.bea.schema.SOMExtension
          extended bycom.bea.schema.SOMRestriction
All Implemented Interfaces:
Serializable

public class SOMRestriction
extends SOMExtension

<restriction> A restricting construct for schema components. The XML representation for restricting a type schema component is either a <restriction>, a <list> or a <union> element information item.

The restriction element provides the ability to add facets to a simpleType definition.

Version:
1.0
Author:
sharpe
See Also:
Serialized Form

Constructor Summary
SOMRestriction(SOMType base)
           
 
Method Summary
 SOMAttribute addAttribute(SOMAttribute attribute)
          add an <attribute> to this complexType.
 SOMAttributeGroup addAttributeGroup(SOMAttributeGroup attribute)
          add an <attributeGroup> to this complexType.
 String createDefault()
          Limited implementation.
 Iterator getFacets()
          returns all facets in this restriction.
 String getID()
          Returns a printable element tag for this Schema Object
 SOMType getType()
          returns the type that is being restricted.
 SOMFacet removeFacet(String facet)
          remove a facet element from this restriction element.
 SOMFacet setDuration(String val)
          Deprecated.  
 SOMFacet setEncoding(String val)
          Deprecated.  
 SOMFacet setEnumeration(String val)
           
 SOMFacet setFacet(String facet_name, String value)
          Use the setFacet method to place restrictions on a previously defined type.
 SOMFacet setFractionDigits(String val)
           
 SOMFacet setLength(String val)
           
 SOMFacet setMaxExclusive(String val)
           
 SOMFacet setMaxInclusive(String val)
           
 SOMFacet setMaxLength(String val)
           
 SOMFacet setMinExclusive(String val)
           
 SOMFacet setMinInclusive(String val)
           
 SOMFacet setMinLength(String val)
           
 void setParent(SOMObject parent)
           
 SOMFacet setPattern(String val)
           
 SOMFacet setPeriod(String val)
          Deprecated.  
 SOMFacet setPrecision(String val)
          Deprecated.  
 SOMFacet setScale(String val)
          Deprecated.  
 SOMFacet setTotalDigits(String val)
           
 void setType(SOMType type)
           
 SOMFacet setWhiteSpace(String val)
           
 
Methods inherited from class com.bea.schema.SOMExtension
addAnnotation, addAttribute, addAttribute, contains, createDefault, getAnnotation, getAttributeElements, getAttributeGroups, getAttributes, getBase, listAttributesExtended, removeAllAttributeGroups, removeAllAttributes, removeAnnotation, removeAttribute, removeAttributeGroup, setBase, setBase, toXML
 
Methods inherited from class com.bea.schema.SOMObject
addPrefixMapping, getContainmentXPath, getEffectivePrefixMappings, getID_UQ, getParent, getParentName, getParentSchema, getPrefixForTargetNamespace, getPrefixMapping, getTargetNamespace, getURIForPrefix, isCircularReference, isSchemaChild, msg, msg, removeNamespaceQualifier, removePrefixMapping, setIndent, setTargetNamespace, toString, toXML, toXML, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SOMRestriction

public SOMRestriction(SOMType base)
Method Detail

setType

public void setType(SOMType type)

getType

public SOMType getType()
returns the type that is being restricted. The <restriction> can have a type defined by simpleType or base, but not both. simpleType children are not yet supported.

Returns:
the restricted type

getID

public String getID()
Description copied from class: SOMObject
Returns a printable element tag for this Schema Object

Overrides:
getID in class SOMExtension

getFacets

public Iterator getFacets()
returns all facets in this restriction. Iterates over a collection of SOMFacet.

Returns:
Iterator of SOMFacet's

setFacet

public SOMFacet setFacet(String facet_name,
                         String value)
                  throws ArrayIndexOutOfBoundsException
Use the setFacet method to place restrictions on a previously defined type. Using the constants defined in SOMFacet, this method creates a valid facet object and adds it to this restriction.

For example, would be created using the arguments setFacet(SOMFacet.maxExclusive, "100");

Parameters:
value - a value for the new facet.
Returns:
a reference to the newly created facet.
Throws:
ArrayIndexOutOfBoundsException - If the facet_type is not a valid index defined in SOMFacet, ArrayIndexOutOfBoundsException will be thrown.

setLength

public SOMFacet setLength(String val)

setMinLength

public SOMFacet setMinLength(String val)

setMaxLength

public SOMFacet setMaxLength(String val)

setPattern

public SOMFacet setPattern(String val)

setEnumeration

public SOMFacet setEnumeration(String val)

setWhiteSpace

public SOMFacet setWhiteSpace(String val)

setMaxInclusive

public SOMFacet setMaxInclusive(String val)

setMaxExclusive

public SOMFacet setMaxExclusive(String val)

setMinExclusive

public SOMFacet setMinExclusive(String val)

setMinInclusive

public SOMFacet setMinInclusive(String val)

setTotalDigits

public SOMFacet setTotalDigits(String val)

setFractionDigits

public SOMFacet setFractionDigits(String val)

setPrecision

public SOMFacet setPrecision(String val)
Deprecated.  

Since:
3/16/2001

setScale

public SOMFacet setScale(String val)
Deprecated.  

Since:
3/16/2001

setEncoding

public SOMFacet setEncoding(String val)
Deprecated.  

Since:
3/16/2001

setDuration

public SOMFacet setDuration(String val)
Deprecated.  

Since:
3/16/2001

setPeriod

public SOMFacet setPeriod(String val)
Deprecated.  

Since:
3/16/2001

removeFacet

public SOMFacet removeFacet(String facet)
remove a facet element from this restriction element. For example, removeFacet(SOMFacet.length)

Parameters:
facet - the facet name from SOMFacet declared facets
Returns:
the removed facet element, or null if facet wasn't found

addAttribute

public SOMAttribute addAttribute(SOMAttribute attribute)
Description copied from class: SOMExtension
add an <attribute> to this complexType. <attribute> is mutually exclusive with simpleContent and complexContent, as well as, attributeGroup

Overrides:
addAttribute in class SOMExtension
Parameters:
attribute - the attribute to add
Returns:
the attribute reference added

addAttributeGroup

public SOMAttributeGroup addAttributeGroup(SOMAttributeGroup attribute)
Description copied from class: SOMExtension
add an <attributeGroup> to this complexType. <attributeGroup> is mutually exclusive with simpleContent and complexContent, as well as, attribute

Overrides:
addAttributeGroup in class SOMExtension
Parameters:
attribute - the attributeGroup to add
Returns:
the attributeGroup reference added

setParent

public void setParent(SOMObject parent)
Overrides:
setParent in class SOMObject

createDefault

public String createDefault()
Limited implementation. Returns default content for the base type.