FileDocCategorySizeDatePackage
Element.javaAPI DocphoneME MR2 API (J2ME)5563Wed May 02 18:00:34 BST 2007javax.microedition.xml.rpc

Element

public class Element extends Type
The class Element is a special Object used to represent an xsd:element defined in a Web Service's WSDL definition. An element can have the additional properties of being an array, being nillable, and has minOccurs and maxOccurs values.
version
0.1
see
javax.xml.rpc.Stub
see
javax.microedition.xml.rpc.Operation

Fields Summary
public final QName
name
The QName of this element
public final Type
contentType
The Type of this Element's content.
public final boolean
isNillable
True if this element is nillable
public final boolean
isArray
True if this element is an array
public final boolean
isOptional
True if this element is optional, that is, its minOccurs is defined as being 0.
public final int
minOccurs
The 'minOccurs' attribute of this element. -1 if this element has no 'minOccurs' attribute.
public final int
maxOccurs
The 'maxOccurs' attribute of this element. -1 if this element has no 'maxOccurs' attribute.
public static final int
UNBOUNDED
Constant use to indicate that maxOccurrs is unbounded.
Constructors Summary
public Element(QName name, Type type, int minOccurs, int maxOccurs, boolean nillable)
Construct an Element with the given properties. This Type subclass will have an intValue() of 9.

param
name the QName of this element
param
type the Type of this element's content
param
minOccurs indicates the minimum number of times this element can occur. A value of '0' indicates this element is optional.
param
maxOccurs indicates the maximum number of times this element can occur. A value > 1, in addition to isArray being true, indicates this element is an array.
throws
IllegalArgumentException
  • if minOccurs < 0, or
  • if name or type are null
  • if type is an instance of Element


                                                                                                                                                                                                     
      
                    
                    
                    
                      
    
        super(9);

        if (name == null || type == null || type instanceof Element) {
            throw new IllegalArgumentException();
        }

        this.name = name;
        this.contentType = type;

        if (minOccurs < 0 || (maxOccurs <= 0 && maxOccurs != UNBOUNDED)) {
            throw new IllegalArgumentException("[min|max]Occurs must >= 0");
        } else if (maxOccurs < minOccurs && maxOccurs != UNBOUNDED) {
            throw new IllegalArgumentException("maxOccurs must > minOccurs");
        }
        this.minOccurs = minOccurs;
        this.isOptional = (minOccurs == 0);
        this.maxOccurs = maxOccurs;
        this.isArray = (maxOccurs > 1 || maxOccurs == UNBOUNDED);
        this.isNillable = nillable;
    
public Element(QName name, Type type)
Construct an Element with the given properties. The defaults for the unspecified properties are:
  • minOccurs = 1
  • maxOccurs = 1
  • isOptional = false
  • isArray = false
  • nillable = false
This Type subclass will have an intValue() of 9.

param
name the QName of this element
param
type the Type of this element's content
throws
IllegalArgumentException
  • if name or type are null
  • if type is an instance of Element

        super(9);

        if (name == null || type == null || type instanceof Element) {
            throw new IllegalArgumentException();
        }

        this.name = name;
        this.contentType = type;
        this.minOccurs = 1;
        this.maxOccurs = 1;
        this.isArray = false;
        this.isOptional = false;
        this.isNillable = false;
    
Methods Summary