4 * This file was generated by XMLSpy 2007sp2 Enterprise Edition.
6 * YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
7 * OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
9 * Refer to the XMLSpy Documentation for further details.
10 * http://www.altova.com/xmlspy
14 package com.jmex.xml.types;
18 public class SchemaAnyURI implements SchemaType {
20 protected boolean isempty;
21 protected boolean isnull;
24 public SchemaAnyURI() {
28 public SchemaAnyURI(SchemaAnyURI newvalue) {
29 value = newvalue.value;
30 isempty = newvalue.isempty;
31 isnull = newvalue.isnull;
34 public SchemaAnyURI(URI newvalue) {
38 public SchemaAnyURI(String newvalue) {
42 public SchemaAnyURI(SchemaType newvalue) {
47 public URI getValue() {
51 public void setValue(URI newvalue) {
52 if( newvalue == null ) {
63 public void parse(String s) {
65 String newvalue = SchemaNormalizedString.normalize(SchemaNormalizedString.WHITESPACE_COLLAPSE, s);
67 if( newvalue == null )
69 else if( newvalue.length() == 0)
74 value = URI.create(newvalue);
76 catch (IllegalArgumentException e) {
77 throw new StringParseException(e);
84 public void assign(SchemaType newvalue) {
85 if( newvalue == null || newvalue.isNull() )
87 else if( newvalue.isEmpty() )
90 if( newvalue instanceof SchemaString )
91 parse(newvalue.toString());
92 else if( newvalue instanceof SchemaAnyURI)
93 setValue(((SchemaAnyURI)newvalue).value);
95 throw new TypesIncompatibleException( newvalue, this );
99 public void setNull() {
105 public void setEmpty() {
106 parse("http://www.altova.com/language_select.html");
110 public int hashCode() {
111 return value.hashCode();
114 public boolean equals(Object obj) {
115 if (! (obj instanceof SchemaAnyURI))
117 return value.equals(( (SchemaAnyURI) obj).value);
120 public Object clone() {
121 return new SchemaAnyURI(this);
124 public String toString() {
125 if( isempty || isnull || value == null )
127 return value.toString();
130 public int length() {
131 return value.toString().length();
134 public boolean booleanValue() {
135 return (value != null && value.toString().length() != 0);
138 public boolean isEmpty() {
142 public boolean isNull() {
146 public int compareTo(Object obj) {
147 return compareTo( (SchemaAnyURI) obj);
150 public int compareTo(SchemaAnyURI obj) {
151 return toString().compareTo( obj.toString() );