WebLogic Integration


com.bea.schema
Class SOMRestriction

java.lang.Object
  |
  +--com.bea.schema.SOMObject
        |
        +--com.bea.schema.SOMRestriction

public class SOMRestriction
extends SOMObject

<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.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Serialized Form

Constructor Summary
protected SOMRestriction(org.xml.sax.Attributes attrs)
           
  SOMRestriction(SOMType base)
           
 
Method Summary
 SOMAnnotation addAnnotation(SOMAnnotation annotation)
           
protected  SOMObject addChild(java.lang.String tagName, org.xml.sax.Attributes attrs)
           
 java.lang.String createDefault()
          Limited implementation.
 java.util.Map getAttributes(boolean getAll)
          retrieve the attributes for this schema element.
 SOMType getBase()
           
 java.util.Iterator getFacets()
          returns all facets in this restriction.
 java.lang.String getID()
           
 SOMType getType()
          returns the type that is being restricted.
 SOMAnnotation removeAnnotation()
          set the annotation for this type to null.
 SOMFacet removeFacet(java.lang.String facet)
          remove a facet element from this restriction element.
 void setBase(SOMType type)
           
 SOMFacet setDuration(java.lang.String val)
          Deprecated.  
 SOMFacet setEncoding(java.lang.String val)
          Deprecated.  
 SOMFacet setEnumeration(java.lang.String val)
           
 SOMFacet setFacet(java.lang.String facet_name, java.lang.String value)
          Use the setFacet method to place restrictions on a previously defined type.
 SOMFacet setFractionDigits(java.lang.String val)
           
 SOMFacet setLength(java.lang.String val)
           
 SOMFacet setMaxExclusive(java.lang.String val)
           
 SOMFacet setMaxInclusive(java.lang.String val)
           
 SOMFacet setMaxLength(java.lang.String val)
           
 SOMFacet setMinExclusive(java.lang.String val)
           
 SOMFacet setMinInclusive(java.lang.String val)
           
 SOMFacet setMinLength(java.lang.String val)
           
 SOMFacet setPattern(java.lang.String val)
           
 SOMFacet setPeriod(java.lang.String val)
          Deprecated.  
 SOMFacet setPrecision(java.lang.String val)
          Deprecated.  
 SOMFacet setScale(java.lang.String val)
          Deprecated.  
 SOMFacet setTotalDigits(java.lang.String val)
           
 void setType(SOMType type)
           
 SOMFacet setWhiteSpace(java.lang.String val)
           
 void toXML(java.io.Writer rtn, int indent)
           
protected  void validate(org.w3c.dom.Node element, java.util.List errorList)
           
 
Methods inherited from class com.bea.schema.SOMObject
attributesToXML, doIndent, getID_UQ, getParent, getParentSchema, isCircularReference, isSchemaChild, setIndent, setParent, toString, toXML, toXML, toXML, trace, trace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SOMRestriction

public SOMRestriction(SOMType base)

SOMRestriction

protected SOMRestriction(org.xml.sax.Attributes attrs)
Method Detail

setBase

public void setBase(SOMType type)

setType

public void setType(SOMType type)

getBase

public SOMType getBase()

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 java.lang.String getID()

Overrides:
getID in class SOMObject

getFacets

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

Returns:
Iterator of SOMFacet's

setFacet

public SOMFacet setFacet(java.lang.String facet_name,
                         java.lang.String value)
                  throws java.lang.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:
facet_type -  
value - a value for the new facet.
Returns:
a reference to the newly created facet.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If the facet_type is not a valid index defined in SOMFacet, ArrayIndexOutOfBoundsException will be thrown.

setLength

public SOMFacet setLength(java.lang.String val)

setMinLength

public SOMFacet setMinLength(java.lang.String val)

setMaxLength

public SOMFacet setMaxLength(java.lang.String val)

setPattern

public SOMFacet setPattern(java.lang.String val)

setEnumeration

public SOMFacet setEnumeration(java.lang.String val)

setWhiteSpace

public SOMFacet setWhiteSpace(java.lang.String val)

setMaxInclusive

public SOMFacet setMaxInclusive(java.lang.String val)

setMaxExclusive

public SOMFacet setMaxExclusive(java.lang.String val)

setMinExclusive

public SOMFacet setMinExclusive(java.lang.String val)

setMinInclusive

public SOMFacet setMinInclusive(java.lang.String val)

setTotalDigits

public SOMFacet setTotalDigits(java.lang.String val)

setFractionDigits

public SOMFacet setFractionDigits(java.lang.String val)

setPrecision

public SOMFacet setPrecision(java.lang.String val)
Deprecated.  

Since:
3/16/2001

setScale

public SOMFacet setScale(java.lang.String val)
Deprecated.  

Since:
3/16/2001

setEncoding

public SOMFacet setEncoding(java.lang.String val)
Deprecated.  

Since:
3/16/2001

setDuration

public SOMFacet setDuration(java.lang.String val)
Deprecated.  

Since:
3/16/2001

setPeriod

public SOMFacet setPeriod(java.lang.String val)
Deprecated.  

Since:
3/16/2001

addAnnotation

public SOMAnnotation addAnnotation(SOMAnnotation annotation)

removeAnnotation

public SOMAnnotation removeAnnotation()
set the annotation for this type to null.

Returns:
the removed annotation, or null if none was present

removeFacet

public SOMFacet removeFacet(java.lang.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

getAttributes

public java.util.Map getAttributes(boolean getAll)
retrieve the attributes for this schema element. If getAll is false, only the attributes that are not set to their default value are returned. If getAll is true, all possible attributes for this element will be returned.

Parameters:
getAll - get all attributes
Returns:
a Hashtable of attributes, where the attribute name and value are stored as strings.

addChild

protected SOMObject addChild(java.lang.String tagName,
                             org.xml.sax.Attributes attrs)
                      throws org.xml.sax.SAXException

Overrides:
addChild in class SOMObject

toXML

public void toXML(java.io.Writer rtn,
                  int indent)
           throws java.io.IOException

Overrides:
toXML in class SOMObject

createDefault

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

validate

protected void validate(org.w3c.dom.Node element,
                        java.util.List errorList)

WebLogic Integration

WebLogic Integration (WLI)