Elementpublic 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. |
Fields Summary |
---|
public final QName | nameThe QName of this element | public final Type | contentTypeThe Type of this Element's content. | public final boolean | isNillableTrue if this element is nillable | public final boolean | isArrayTrue if this element is an array | public final boolean | isOptionalTrue if this element is optional, that is, its minOccurs
is defined as being 0. | public final int | minOccursThe 'minOccurs' attribute of this element. -1 if this
element has no 'minOccurs' attribute. | public final int | maxOccursThe 'maxOccurs' attribute of this element. -1 if this
element has no 'maxOccurs' attribute. | public static final int | UNBOUNDEDConstant 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.
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.
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;
|
|