2 * SchemaBase64Binary.java
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;
17 public class SchemaBase64Binary extends SchemaBinaryBase {
19 public SchemaBase64Binary() {
23 public SchemaBase64Binary(SchemaBase64Binary newvalue) {
24 value = newvalue.value;
25 isempty = newvalue.isempty;
26 isnull = newvalue.isnull;
29 public SchemaBase64Binary(byte[] newvalue) {
33 public SchemaBase64Binary(String newvalue) {
37 public SchemaBase64Binary(SchemaType newvalue) {
41 public SchemaBase64Binary(SchemaTypeBinary newvalue) {
42 assign( (SchemaType)newvalue );
46 public void parse(String s) {
48 String newvalue = SchemaNormalizedString.normalize(SchemaNormalizedString.WHITESPACE_COLLAPSE, s);
50 if( newvalue == null )
52 else if( newvalue.length() == 0)
57 value = new sun.misc.BASE64Decoder().decodeBuffer(newvalue);
59 isempty = ( value.length == 0 ) ? true : false;
61 catch( java.io.IOException e ) {
68 public int hashCode() {
69 return value.hashCode();
72 public boolean equals(Object obj) {
73 if (! (obj instanceof SchemaBase64Binary))
75 return value.equals(( (SchemaBase64Binary) obj).value);
78 public Object clone() {
79 return new SchemaBase64Binary( this );
82 public String toString() {
83 if( isempty || isnull || value == null )
85 String sResult = new sun.misc.BASE64Encoder().encode(value);
86 return sResult.replaceAll( "\r", "" );
89 // ---------- interface SchemaTypeBinary ----------
90 public int binaryType() {
91 return BINARY_VALUE_BASE64;