1 7 8 package org.apache.jetspeed.xml.api.jcm; 9 10 14 import java.io.Reader ; 15 import java.io.Serializable ; 16 import java.io.Writer ; 17 import org.exolab.castor.xml.*; 18 import org.exolab.castor.xml.MarshalException; 19 import org.exolab.castor.xml.ValidationException; 20 import org.xml.sax.DocumentHandler ; 21 22 26 public class Image implements java.io.Serializable { 27 28 29 33 private java.lang.String _title; 34 35 private java.lang.String _url; 36 37 private java.lang.String _link; 38 39 private java.lang.String _description; 40 41 private int _width; 42 43 46 private boolean _has_width; 47 48 private int _height; 49 50 53 private boolean _has_height; 54 55 56 60 public Image() { 61 super(); 62 } 64 65 69 71 public void deleteHeight() 72 { 73 this._has_height= false; 74 } 76 78 public void deleteWidth() 79 { 80 this._has_width= false; 81 } 83 85 public java.lang.String getDescription() 86 { 87 return this._description; 88 } 90 92 public int getHeight() 93 { 94 return this._height; 95 } 97 99 public java.lang.String getLink() 100 { 101 return this._link; 102 } 104 106 public java.lang.String getTitle() 107 { 108 return this._title; 109 } 111 113 public java.lang.String getUrl() 114 { 115 return this._url; 116 } 118 120 public int getWidth() 121 { 122 return this._width; 123 } 125 127 public boolean hasHeight() 128 { 129 return this._has_height; 130 } 132 134 public boolean hasWidth() 135 { 136 return this._has_width; 137 } 139 141 public boolean isValid() 142 { 143 try { 144 validate(); 145 } 146 catch (org.exolab.castor.xml.ValidationException vex) { 147 return false; 148 } 149 return true; 150 } 152 156 public void marshal(java.io.Writer out) 157 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 158 { 159 160 Marshaller.marshal(this, out); 161 } 163 167 public void marshal(org.xml.sax.DocumentHandler handler) 168 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 169 { 170 171 Marshaller.marshal(this, handler); 172 } 174 178 public void setDescription(java.lang.String description) 179 { 180 this._description = description; 181 } 183 187 public void setHeight(int height) 188 { 189 this._height = height; 190 this._has_height = true; 191 } 193 197 public void setLink(java.lang.String link) 198 { 199 this._link = link; 200 } 202 206 public void setTitle(java.lang.String title) 207 { 208 this._title = title; 209 } 211 215 public void setUrl(java.lang.String url) 216 { 217 this._url = url; 218 } 220 224 public void setWidth(int width) 225 { 226 this._width = width; 227 this._has_width = true; 228 } 230 234 public static org.apache.jetspeed.xml.api.jcm.Image unmarshal(java.io.Reader reader) 235 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 236 { 237 return (org.apache.jetspeed.xml.api.jcm.Image) Unmarshaller.unmarshal(org.apache.jetspeed.xml.api.jcm.Image.class, reader); 238 } 240 242 public void validate() 243 throws org.exolab.castor.xml.ValidationException 244 { 245 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 246 validator.validate(this); 247 } 249 } 250 | Popular Tags |