1 /**
2 * Redistribution and use of this software and associated documentation
3 * ("Software"), with or without modification, are permitted provided
4 * that the following conditions are met:
5 *
6 * 1. Redistributions of source code must retain copyright
7 * statements and notices. Redistributions must also contain a
8 * copy of this document.
9 *
10 * 2. Redistributions in binary form must reproduce the
11 * above copyright notice, this list of conditions and the
12 * following disclaimer in the documentation and/or other
13 * materials provided with the distribution.
14 *
15 * 3. The name "Exolab" must not be used to endorse or promote
16 * products derived from this Software without prior written
17 * permission of Intalio, Inc. For written permission,
18 * please contact info@exolab.org.
19 *
20 * 4. Products derived from this Software may not be called "Exolab"
21 * nor may "Exolab" appear in their names without prior written
22 * permission of Intalio, Inc. Exolab is a registered
23 * trademark of Intalio, Inc.
24 *
25 * 5. Due credit should be given to the Exolab Project
26 * (http://www.exolab.org/).
27 *
28 * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS
29 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
30 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
32 * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39 * OF THE POSSIBILITY OF SUCH DAMAGE.
40 *
41 * Copyright 1999-2002 (C) Intalio, Inc. All Rights Reserved.
42 *
43 * $Id$
44 */
45
46 package org.exolab.castor.mapping.loader;
47
48 import org.exolab.castor.mapping.FieldDescriptor;
49 import org.exolab.castor.mapping.FieldHandler;
50
51 /**
52 * An extended version of the FieldHandler interface which is used for adding
53 * additional functionality while preserving backward compatability.
54 *
55 * @author <a href="kvisco@intalio.com">Keith Visco</a>
56 * @version $Revision$ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar
57 * 2003) $
58 * @see FieldDescriptor
59 * @see FieldHandler
60 */
61 public abstract class ExtendedFieldHandler<T> implements FieldHandler<T> {
62
63 // /**
64 // * Returns the FieldDescriptor for the field that this handler is responsible
65 // * for, or null if no FieldDescriptor has been set. This method is useful for
66 // * implementations of the FieldHandler interface that wish to obtain
67 // * information about the field in order to make the FieldHandler more generic
68 // * and reusable, or simply for validation purposes.
69 // *
70 // * @return the FieldDescriptor, or null if none exists.
71 // */
72 // protected abstract FieldDescriptor getFieldDescriptor();
73 //
74 // /**
75 // * Sets the FieldDescriptor that this FieldHander is responsible for. By
76 // * setting the FieldDescriptor, it allows the implementation of the
77 // * FieldHandler methods to obtain information about the field itself. This
78 // * allows a particular implementation to become more generic and reusable.
79 // *
80 // * @param fieldDesc
81 // * the FieldDescriptor to set
82 // */
83 // protected abstract void setFieldDescriptor(FieldDescriptor fieldDesc);
84
85 // /**
86 // * @deprecated No longer supported
87 // */
88 // public final void checkValidity(Object object) throws ValidityException, IllegalStateException {
89 // // -- do nothing...deprecated method
90 // } // -- checkValidity
91 //
92 // /**
93 // * Returns the value of the field from the object.
94 // *
95 // * @param object
96 // * The object
97 // * @return The value of the field
98 // * @throws IllegalStateException
99 // * The Java object has changed and is no longer supported by this
100 // * handler, or the handler is not compatiable with the Java object
101 // */
102 // public abstract Object getValue(Object object) throws IllegalStateException;
103 //
104 // /**
105 // * Creates a new instance of the object described by this field.
106 // *
107 // * @param parent
108 // * The object for which the field is created
109 // * @return A new instance of the field's value
110 // * @throws IllegalStateException
111 // * This field is a simple type and cannot be instantiated
112 // */
113 // public abstract Object newInstance(Object parent) throws IllegalStateException;
114 //
115 // /**
116 // * Sets the value of the field to a default value.
117 // * <p>
118 // * Reference fields are set to null, primitive fields are set to their
119 // * default value, collection fields are emptied of all elements.
120 // *
121 // * @param object
122 // * The object
123 // * @throws IllegalStateException
124 // * The Java object has changed and is no longer supported by this
125 // * handler, or the handler is not compatiable with the Java object
126 // */
127 // public abstract void resetValue(Object object) throws IllegalStateException, IllegalArgumentException;
128 //
129 // /**
130 // * Sets the value of the field on the object.
131 // *
132 // * @param object
133 // * The object
134 // * @param value
135 // * The new value
136 // * @throws IllegalStateException
137 // * The Java object has changed and is no longer supported by this
138 // * handler, or the handler is not compatiable with the Java object
139 // * @throws IllegalArgumentException
140 // * The value passed is not of a supported type
141 // */
142 // public abstract void setValue(Object object, Object value) throws IllegalStateException,
143 // IllegalArgumentException;
144
145 }
146