1 7 8 package org.openejb.alt.config.sys; 9 10 14 import java.io.IOException ; 15 import java.io.Reader ; 16 import java.io.Serializable ; 17 import java.io.Writer ; 18 import org.exolab.castor.xml.MarshalException; 19 import org.exolab.castor.xml.Marshaller; 20 import org.exolab.castor.xml.Unmarshaller; 21 import org.exolab.castor.xml.ValidationException; 22 import org.xml.sax.ContentHandler ; 23 24 29 public class PropertiesFile implements java.io.Serializable { 30 31 32 36 39 private java.lang.String _file; 40 41 42 46 public PropertiesFile() { 47 super(); 48 } 50 51 55 60 public java.lang.String getFile() 61 { 62 return this._file; 63 } 65 68 public boolean isValid() 69 { 70 try { 71 validate(); 72 } 73 catch (org.exolab.castor.xml.ValidationException vex) { 74 return false; 75 } 76 return true; 77 } 79 84 public void marshal(java.io.Writer out) 85 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 86 { 87 88 Marshaller.marshal(this, out); 89 } 91 96 public void marshal(org.xml.sax.ContentHandler handler) 97 throws java.io.IOException , org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 98 { 99 100 Marshaller.marshal(this, handler); 101 } 103 108 public void setFile(java.lang.String file) 109 { 110 this._file = file; 111 } 113 118 public static java.lang.Object unmarshal(java.io.Reader reader) 119 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException 120 { 121 return (org.openejb.alt.config.sys.PropertiesFile) Unmarshaller.unmarshal(org.openejb.alt.config.sys.PropertiesFile.class, reader); 122 } 124 127 public void validate() 128 throws org.exolab.castor.xml.ValidationException 129 { 130 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 131 validator.validate(this); 132 } 134 } 135 | Popular Tags |