public class XmlSchemaRestriction extends Object
XmlSchemaFacet
. It uses an enum to more easily
work with different facets, and its equals(Object)
and
hashCode()
reflect that only enumerations and patterns can have
multiple constraints.Modifier and Type | Class and Description |
---|---|
static class |
XmlSchemaRestriction.Type
The facet type: one of the known constraining
facets defined by XML Schema.
|
Constructor and Description |
---|
XmlSchemaRestriction(XmlSchemaRestriction.Type type)
Constructs a new
XmlSchemaRestriction from only the XmlSchemaRestriction.Type . |
XmlSchemaRestriction(XmlSchemaRestriction.Type type,
Object value,
boolean isFixed)
Constructs a new
XmlSchemaRestriction from the XmlSchemaRestriction.Type ,
constraining value, and whether the facet may be overridden by child type
definitions. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines equality.
|
XmlSchemaRestriction.Type |
getType()
The constraining facet's
XmlSchemaRestriction.Type . |
Object |
getValue()
The facet's constraint value.
|
int |
hashCode()
Generates a hash code based on the contents.
|
boolean |
isFixed()
Whether the constraint value may be overridden in child definitions (
true means it cannot). |
void |
setFixed(boolean isFixed)
Sets whether the constraint value may be overridden in child definitions
(
true means that it cannot). |
void |
setValue(Object value)
Sets the constraint value.
|
String |
toString()
Returns a
String representation of this facet. |
public XmlSchemaRestriction(XmlSchemaRestriction.Type type)
XmlSchemaRestriction
from only the XmlSchemaRestriction.Type
.type
- The facet's type.public XmlSchemaRestriction(XmlSchemaRestriction.Type type, Object value, boolean isFixed)
XmlSchemaRestriction
from the XmlSchemaRestriction.Type
,
constraining value, and whether the facet may be overridden by child type
definitions.type
- The constraining facet type.value
- The constraining value.isFixed
- Whether the value may be overridden in child definitions.public XmlSchemaRestriction.Type getType()
XmlSchemaRestriction.Type
.public Object getValue()
public boolean isFixed()
true
means it cannot).public void setValue(Object value)
public void setFixed(boolean isFixed)
true
means that it cannot).public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.