📄 schemaanyuri.java
字号:
/**
* SchemaAnyURI.java
*
* This file was generated by XMLSpy 2007sp2 Enterprise Edition.
*
* YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
* OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
*
* Refer to the XMLSpy Documentation for further details.
* http://www.altova.com/xmlspy
*/
package com.jmex.xml.types;
import java.net.URI;
public class SchemaAnyURI implements SchemaType {
protected URI value;
protected boolean isempty;
protected boolean isnull;
// construction
public SchemaAnyURI() {
setEmpty();
}
public SchemaAnyURI(SchemaAnyURI newvalue) {
value = newvalue.value;
isempty = newvalue.isempty;
isnull = newvalue.isnull;
}
public SchemaAnyURI(URI newvalue) {
setValue( newvalue );
}
public SchemaAnyURI(String newvalue) {
parse( newvalue );
}
public SchemaAnyURI(SchemaType newvalue) {
assign( newvalue );
}
// getValue, setValue
public URI getValue() {
return value;
}
public void setValue(URI newvalue) {
if( newvalue == null ) {
isempty = true;
isnull = true;
}
else {
isnull = false;
isempty = false;
value = newvalue;
}
}
public void parse(String s) {
String newvalue = SchemaNormalizedString.normalize(SchemaNormalizedString.WHITESPACE_COLLAPSE, s);
if( newvalue == null )
setNull();
else if( newvalue.length() == 0)
setEmpty();
else {
setNull();
try {
value = URI.create(newvalue);
}
catch (IllegalArgumentException e) {
throw new StringParseException(e);
}
isnull = false;
isempty = false;
}
}
public void assign(SchemaType newvalue) {
if( newvalue == null || newvalue.isNull() )
setNull();
else if( newvalue.isEmpty() )
setEmpty();
else {
if( newvalue instanceof SchemaString )
parse(newvalue.toString());
else if( newvalue instanceof SchemaAnyURI)
setValue(((SchemaAnyURI)newvalue).value);
else
throw new TypesIncompatibleException( newvalue, this );
}
}
public void setNull() {
isnull = true;
isempty = true;
value = null;
}
public void setEmpty() {
parse("http://www.altova.com/language_select.html");
}
// further
public int hashCode() {
return value.hashCode();
}
public boolean equals(Object obj) {
if (! (obj instanceof SchemaAnyURI))
return false;
return value.equals(( (SchemaAnyURI) obj).value);
}
public Object clone() {
return new SchemaAnyURI(this);
}
public String toString() {
if( isempty || isnull || value == null )
return "";
return value.toString();
}
public int length() {
return value.toString().length();
}
public boolean booleanValue() {
return (value != null && value.toString().length() != 0);
}
public boolean isEmpty() {
return isempty;
}
public boolean isNull() {
return isnull;
}
public int compareTo(Object obj) {
return compareTo( (SchemaAnyURI) obj);
}
public int compareTo(SchemaAnyURI obj) {
return toString().compareTo( obj.toString() );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -