public abstract class Length extends Object
The value of length ???must??? be a nonNegativeInteger. Length is defined as:
For string and datatypes ???derived??? from string, length will not always coincide with "string length" as perceived by some users or with the number of storage units in some digital representation. Therefore, care should be taken when specifying a value for length and in attempting to infer storage requirements from a given value for length.
Example:
<simpleType name='productCode'>
<restriction base='string'>
<length value='8' fixed='true'/>
</restriction>
</simpleType>
Modifier and Type | Field and Description |
---|---|
static Length |
CHARACTERS
string and anyURI measured length is measured in units of characters
|
static Length |
LIST
By default this one understands Collection, Array and Integer.
|
static Length |
OCTETS
hexBinary and base64Binary length is measured in octets (8bits) on binary data
|
Modifier and Type | Method and Description |
---|---|
int |
length(XSDTypeDefinition definition) |
abstract void |
validate(XSDTypeDefinition definition,
Object value) |
public static final Length CHARACTERS
public static final Length OCTETS
public static final Length LIST
So if you are checking a custom object please pass in an Integer representing the size of your object.
public int length(XSDTypeDefinition definition)
public abstract void validate(XSDTypeDefinition definition, Object value) throws IllegalArgumentException
IllegalArgumentException
Copyright © 1996–2019 Geotools. All rights reserved.