Class XmlSchemaRestriction
java.lang.Object
org.apache.ws.commons.schema.walker.XmlSchemaRestriction
This represents an
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe facet type: one of the known constraining facets defined by XML Schema. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate XmlSchemaRestriction.Typeprivate Object -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newXmlSchemaRestrictionfrom only theXmlSchemaRestriction.Type.XmlSchemaRestriction(XmlSchemaRestriction.Type type, Object value, boolean isFixed) Constructs a newXmlSchemaRestrictionfrom theXmlSchemaRestriction.Type, constraining value, and whether the facet may be overridden by child type definitions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines equality.getType()The constraining facet'sXmlSchemaRestriction.Type.getValue()The facet's constraint value.inthashCode()Generates a hash code based on the contents.booleanisFixed()Whether the constraint value may be overridden in child definitions (truemeans it cannot).voidsetFixed(boolean isFixed) Sets whether the constraint value may be overridden in child definitions (truemeans that it cannot).voidSets the constraint value.toString()Returns aStringrepresentation of this facet.
-
Field Details
-
type
-
value
-
isFixed
private boolean isFixed
-
-
Constructor Details
-
XmlSchemaRestriction
XmlSchemaRestriction(XmlSchemaFacet facet) -
XmlSchemaRestriction
Constructs a newXmlSchemaRestrictionfrom only theXmlSchemaRestriction.Type.- Parameters:
type- The facet's type.
-
XmlSchemaRestriction
Constructs a newXmlSchemaRestrictionfrom theXmlSchemaRestriction.Type, constraining value, and whether the facet may be overridden by child type definitions.- Parameters:
type- The constraining facet type.value- The constraining value.isFixed- Whether the value may be overridden in child definitions.
-
-
Method Details
-
getType
The constraining facet'sXmlSchemaRestriction.Type. -
getValue
The facet's constraint value. -
isFixed
public boolean isFixed()Whether the constraint value may be overridden in child definitions (truemeans it cannot). -
setValue
Sets the constraint value. -
setFixed
public void setFixed(boolean isFixed) Sets whether the constraint value may be overridden in child definitions (truemeans that it cannot). -
hashCode
public int hashCode()Generates a hash code based on the contents. If the type is an enumeration, then the isFixed and value elements are used in calculating the hash code. All of the other Restrictions are considered to be the same. -
equals
Determines equality. If the type is an enumeration, then the isFixed and value elements are used determining equality. All of the other Restrictions are considered to be equal to each other. -
toString
Returns aStringrepresentation of this facet.
-