Commits

Anonymous committed 8b72c2d

This commit was manufactured by cvs2svn to create branch 'os'.

git-svn-id: http://svn.opensymphony.com/svn/propertyset/branches/os@15bf3cbcdd-1c1a-0410-9a68-d6f521e3fa7b

  • Participants
  • Parent commits cc0fd67
  • Branches os

Comments (0)

Files changed (37)

lib/build/jalopy/aelfred-1.2.jar

Binary file added.

lib/build/jalopy/jalopy-1.0b10.jar

Binary file added.

lib/build/jalopy/jalopy-ant-0.6.1.jar

Binary file added.

lib/build/jalopy/jaxp-1.2.jar

Binary file added.

lib/build/jalopy/jdom-1.0b8.jar

Binary file added.

lib/build/jalopy/log4j-1.2.6.jar

Binary file added.

lib/build/jalopy/oro-2.0.6.jar

Binary file added.

lib/build/jalopy/sax-2.0.1.jar

Binary file added.

lib/build/junit-3.8.1.jar

Binary file added.

lib/optional/ejb.jar

Binary file added.

lib/optional/jdbc.jar

Binary file added.

lib/optional/ofbcore-entity.jar

Binary file added.

lib/optional/ofbcore-share.jar

Binary file added.

src/java/com/opensymphony/ejb/EntityAdapter.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.ejb;
+
+import java.rmi.RemoteException;
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+import javax.ejb.*;
+
+
+/**
+ * <p>
+ *   Abstract base adapter class to be extended by EJB EntityBeans. <br>
+ *   Contains default implementations for all require methods to implement EntityBean.
+ * </p>
+ * <p>
+ *   To create an implementation of an Entity, extend this class and add appropriate ejbCreate(),
+ *   ejbPostCreate() and getter/setter methods.
+ * </p>
+ * <p>
+ *   If an auto-generated primary key (<code>long</code>/<code>int</code>) is to be used,
+ * </p>
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public abstract class EntityAdapter extends AbstractEntityAdapter implements EntityBean {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * Required to implement EntityBean. Sets the EntityContext.
+     * Also, attempts to detemine the <code>sequenceName</code>.
+     */
+    public void setEntityContext(EntityContext context) throws EJBException, RemoteException {
+        this.setContext(context);
+    }
+
+    /**
+     * Required to implement EntityBean. Not implemented.
+     */
+    public void ejbActivate() throws EJBException, RemoteException {
+    }
+
+    /**
+     * Required to implement EntityBean. Not implemented.
+     */
+    public void ejbLoad() throws EJBException, RemoteException {
+    }
+
+    /**
+     * Required to implement EntityBean. Not implemented.
+     */
+    public void ejbPassivate() throws EJBException, RemoteException {
+    }
+
+    /**
+     * Required to implement EntityBean. Not implemented.
+     */
+    public void ejbRemove() throws RemoveException, EJBException, RemoteException {
+    }
+
+    /**
+     * Required to implement EntityBean. Not implemented.
+     */
+    public void ejbStore() throws EJBException, RemoteException {
+    }
+
+    /**
+     * Required to implement EntityBean. Sets the EntityContext to null.
+     */
+    public void unsetEntityContext() throws EJBException, RemoteException {
+        context = null;
+    }
+
+    /**
+     * Return EntityContext. To be used by classes extending this.
+     */
+    protected EntityContext getEntityContext() {
+        return context;
+    }
+}

src/java/com/opensymphony/ejb/SessionAdapter.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.ejb;
+
+import java.rmi.RemoteException;
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+import javax.ejb.*;
+
+
+/**
+ * <p>
+ *   Abstract base adapter class to be extended by EJB SessionBeans. <br>
+ *   Contains default implementations for all require methods to implement SessionBean.
+ * </p>
+ * <p>
+ *   To create an implementation of an Session, extend this class and add appropriate ejbCreate()
+ *   and getter/setter methods.
+ * </p>
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public abstract class SessionAdapter implements SessionBean {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    /** Reference to SessionContext. */
+    protected SessionContext context;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /** Required to implement SessionBean. Sets the SessionContext. */
+    public void setSessionContext(SessionContext context) throws RemoteException {
+        this.context = context;
+    }
+
+    /** Required to implement SessionBean. Not implemented. */
+    public void ejbActivate() throws EJBException, RemoteException {
+    }
+
+    /** Required to implement SessionBean. Not implemented. */
+    public void ejbPassivate() throws EJBException, RemoteException {
+    }
+
+    /** Required to implement SessionBean. Not implemented. */
+    public void ejbRemove() throws EJBException, RemoteException {
+    }
+
+    /** Return SessionContext. To be used by classes extending this. */
+    protected SessionContext getSessionContext() throws EJBException, RemoteException {
+        return context;
+    }
+}

src/java/com/opensymphony/module/propertyset/DuplicatePropertyKeyException.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+
+/**
+ * Thrown if a property is set who's key matches a key of an
+ * existing property with different type.
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public class DuplicatePropertyKeyException extends PropertyException {
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public DuplicatePropertyKeyException() {
+        super();
+    }
+
+    public DuplicatePropertyKeyException(String msg) {
+        super(msg);
+    }
+}

src/java/com/opensymphony/module/propertyset/IllegalPropertyException.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+
+/**
+ * Thrown if a property is set which is not allowed.
+ *
+ * <p><i>e.g.</i> non-serializable Object is passed to SerializablePropertySet,
+ * or field is persisted that cannot be stored in database.</p>
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public class IllegalPropertyException extends PropertyException {
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public IllegalPropertyException() {
+        super();
+    }
+
+    public IllegalPropertyException(String msg) {
+        super(msg);
+    }
+}

src/java/com/opensymphony/module/propertyset/InvalidPropertyTypeException.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+
+/**
+ * Thrown if a property is attempted to be retrieved that
+ * does exist but is of different type.
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public class InvalidPropertyTypeException extends PropertyException {
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public InvalidPropertyTypeException() {
+        super();
+    }
+
+    public InvalidPropertyTypeException(String msg) {
+        super(msg);
+    }
+}

src/java/com/opensymphony/module/propertyset/PropertyException.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+
+/**
+ * Parent class of all exceptions thrown by PropertySet.
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public class PropertyException extends RuntimeException {
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public PropertyException() {
+        super();
+    }
+
+    public PropertyException(String msg) {
+        super(msg);
+    }
+}

src/java/com/opensymphony/module/propertyset/PropertyImplementationException.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+
+/**
+ * Thrown if a specific implementation exception is thrown
+ * (such as EJBException, RemoteException, NamingException, IOException, etc).
+ *
+ * <p>A specific Exception can be wrapped in this Exception, by being
+ * passed to the constructor. It can be retrieved via
+ * {@link #getRootCause()} .</p>
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public class PropertyImplementationException extends PropertyException {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    protected Throwable original;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public PropertyImplementationException() {
+        super();
+    }
+
+    public PropertyImplementationException(String msg) {
+        super(msg);
+    }
+
+    public PropertyImplementationException(String msg, Throwable original) {
+        super(msg);
+        this.original = original;
+    }
+
+    public PropertyImplementationException(Throwable original) {
+        this(original.getLocalizedMessage(), original);
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * Retrieve original Exception.
+     */
+    public Throwable getRootCause() {
+        return original;
+    }
+}

src/java/com/opensymphony/module/propertyset/PropertySchema.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+import com.opensymphony.module.propertyset.verifiers.PropertyVerifier;
+import com.opensymphony.module.propertyset.verifiers.VerifyException;
+
+import java.io.Serializable;
+
+import java.util.*;
+
+
+/**
+ * Describes the meta data for a given property.
+ * The meta data for a property includes its type as well as
+ * any verifiers that constrain it.
+ *
+ * todo: add multiplicity?
+ *
+ * @author <a href="mailto:hani@fate.demon.co.uk">Hani Suleiman</a>
+ * @version $Revision$
+ */
+public class PropertySchema implements Serializable {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private Collection verifiers;
+    private String name;
+    private int type;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public PropertySchema() {
+        this(null);
+    }
+
+    public PropertySchema(String name) {
+        super();
+        this.name = name;
+        verifiers = new HashSet();
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setPropertyName(String s) {
+        name = s;
+    }
+
+    public String getPropertyName() {
+        return name;
+    }
+
+    public void setType(int type) {
+        this.type = type;
+    }
+
+    public int getType() {
+        return type;
+    }
+
+    /**
+     * Returns unmodifiable List of verifiers.
+     */
+    public Collection getVerifiers() {
+        return Collections.unmodifiableCollection(verifiers);
+    }
+
+    public boolean addVerifier(PropertyVerifier pv) {
+        return verifiers.add(pv);
+    }
+
+    public boolean removeVerifier(PropertyVerifier pv) {
+        return verifiers.remove(pv);
+    }
+
+    /**
+     * Validate a given value against all verifiers.
+     * Default behaviour is to AND all verifiers.
+     */
+    public void validate(Object value) throws PropertyException {
+        Iterator i = verifiers.iterator();
+
+        while (i.hasNext()) {
+            PropertyVerifier pv = (PropertyVerifier) i.next();
+
+            //Hmm, do we need a try/catch?
+            try {
+                pv.verify(value);
+            } catch (VerifyException ex) {
+                throw new IllegalPropertyException(ex.getMessage());
+            }
+        }
+    }
+}

src/java/com/opensymphony/module/propertyset/PropertySetCloner.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+import java.util.Iterator;
+
+
+/**
+ * The PropertySetCloner is used to copy all the properties from one PropertySet into another.
+ *
+ * <h3>Example</h3>
+ *
+ * <blockquote><code>
+ *   EJBPropertySet source = new EJBPropertySet("ejb/PropertyStore","MyEJB",7);<br>
+ *   XMLPropertySet dest   = new XMLPropertySet();<br>
+ *   <br>
+ *   PropertySetCloner cloner = new PropertySetCloner();<br>
+ *   cloner.setSource( source );<br>
+ *   cloner.setDestination( dest );<br>
+ *   <br>
+ *   cloner.cloneProperties();<br>
+ *   dest.save( new FileWriter("propertyset-MyEJB-7.xml") );<br>
+ * </code></blockquote>
+ *
+ * <p>The above example demonstrates how a PropertySetCloner can be used to export properties
+ * stores in an EJBPropertySet to an XML file.</p>
+ *
+ * <p>If the destination PropertySet contains any properties, they will be cleared before
+ * the source properties are copied across.</p>
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ */
+public class PropertySetCloner {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private PropertySet destination;
+    private PropertySet source;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setDestination(PropertySet destination) {
+        this.destination = destination;
+    }
+
+    public PropertySet getDestination() {
+        return destination;
+    }
+
+    public void setSource(PropertySet source) {
+        this.source = source;
+    }
+
+    public PropertySet getSource() {
+        return source;
+    }
+
+    public void cloneProperties() throws PropertyException {
+        clearDestination();
+
+        Iterator keys = source.getKeys().iterator();
+
+        while (keys.hasNext()) {
+            String key = (String) keys.next();
+            cloneProperty(key);
+        }
+    }
+
+    /**
+     * Clear all properties that already exist in destination PropertySet.
+     */
+    private void clearDestination() throws PropertyException {
+        Iterator keys = destination.getKeys().iterator();
+
+        while (keys.hasNext()) {
+            String key = (String) keys.next();
+            destination.remove(key);
+        }
+    }
+
+    /**
+     * Copy individual property from source to destination.
+     */
+    private void cloneProperty(String key) throws PropertyException {
+        switch (source.getType(key)) {
+        case PropertySet.BOOLEAN:
+            destination.setBoolean(key, source.getBoolean(key));
+
+            break;
+
+        case PropertySet.INT:
+            destination.setInt(key, source.getInt(key));
+
+            break;
+
+        case PropertySet.LONG:
+            destination.setLong(key, source.getLong(key));
+
+            break;
+
+        case PropertySet.DOUBLE:
+            destination.setDouble(key, source.getDouble(key));
+
+            break;
+
+        case PropertySet.STRING:
+            destination.setString(key, source.getString(key));
+
+            break;
+
+        case PropertySet.TEXT:
+            destination.setText(key, source.getText(key));
+
+            break;
+
+        case PropertySet.DATE:
+            destination.setDate(key, source.getDate(key));
+
+            break;
+
+        case PropertySet.OBJECT:
+            destination.setObject(key, source.getObject(key));
+
+            break;
+
+        case PropertySet.XML:
+            destination.setXML(key, source.getXML(key));
+
+            break;
+
+        case PropertySet.DATA:
+            destination.setData(key, source.getData(key));
+
+            break;
+
+        case PropertySet.PROPERTIES:
+            destination.setProperties(key, source.getProperties(key));
+
+            break;
+        }
+    }
+}

src/java/com/opensymphony/module/propertyset/PropertySetSchema.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+import java.io.Serializable;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ *
+ * @author <a href="mailto:hani@fate.demon.co.uk">Hani Suleiman</a>
+ * @version $Revision$
+ */
+public class PropertySetSchema implements Serializable {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private Map propertySchemas;
+    private boolean restricted;
+
+    //~ Constructors ///////////////////////////////////////////////////////////
+
+    public PropertySetSchema() {
+        propertySchemas = new HashMap();
+    }
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public void setPropertySchema(String key, PropertySchema ps) {
+        if (ps.getPropertyName() == null) {
+            ps.setPropertyName(key);
+        }
+
+        propertySchemas.put(key, ps);
+    }
+
+    public PropertySchema getPropertySchema(String key) {
+        return (PropertySchema) propertySchemas.get(key);
+    }
+
+    public void setRestricted(boolean b) {
+        restricted = b;
+    }
+
+    public boolean isRestricted() {
+        return restricted;
+    }
+
+    public void addPropertySchema(PropertySchema ps) {
+        propertySchemas.put(ps.getPropertyName(), ps);
+    }
+}

src/java/com/opensymphony/module/propertyset/aggregate/AggregatePropertySet.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset.aggregate;
+
+import com.opensymphony.module.propertyset.*;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.w3c.dom.Document;
+
+import java.util.*;
+
+
+/**
+ * PropertySet composed of a collection of other propertysets.
+ * Tried each of the propertysets to find a value, tries to be
+ * as fault tolerant as possible, in that when any error occurs,
+ * it simply tries the operation on the next set.
+ * <p>
+ *
+ * <b>Optional Args</b>
+ * <ul>
+ *  <li><b>PropertySets</b> - a List of PropertySet</li>
+ * </ul>
+ *
+ * Date: Dec 16, 2001
+ * Time: 11:28:06 PM
+ * @author Hani Suleiman
+ */
+public class AggregatePropertySet extends AbstractPropertySet {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    private static final Log log = LogFactory.getLog(AggregatePropertySet.class);
+
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private List propertySets;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public Collection getKeys(String prefix, int type) throws PropertyException {
+        Iterator i = propertySets.iterator();
+        Collection keys = new ArrayList();
+
+        while (i.hasNext()) {
+            PropertySet set = (PropertySet) i.next();
+
+            try {
+                keys.addAll(set.getKeys(prefix, type));
+            } catch (PropertyException ex) {
+                //we don't really care about these here
+            }
+        }
+
+        return keys;
+    }
+
+    public boolean isSettable(String property) {
+        Iterator i = propertySets.iterator();
+
+        while (i.hasNext()) {
+            PropertySet set = (PropertySet) i.next();
+
+            if (set.isSettable(property)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Checks all propertysets for the specified property.
+     * If a match is found, the type for the match is returned.
+     * Note that the first match is what is checked,
+     * other propertysets might also define this key, but
+     * they would not be checked.
+     */
+    public int getType(String key) throws PropertyException {
+        Iterator i = propertySets.iterator();
+
+        while (i.hasNext()) {
+            PropertySet set = (PropertySet) i.next();
+
+            try {
+                return set.getType(key);
+            } catch (PropertyException ex) {
+                if (
+                    //we don't really care about these
+                    log.isDebugEnabled()) {
+                    //we don't really care about these
+                    log.debug("Error checking type of " + key + ":" + ex);
+                }
+            }
+        }
+
+        throw new PropertyException("No key " + key + " found");
+    }
+
+    public void addPropertySet(PropertySet propertySet) {
+        propertySets.add(propertySet);
+    }
+
+    public boolean exists(String key) throws PropertyException {
+        Iterator i = propertySets.iterator();
+
+        while (i.hasNext()) {
+            PropertySet set = (PropertySet) i.next();
+
+            try {
+                if (set.exists(key)) {
+                    return true;
+                }
+            } catch (PropertyException ex) {
+                log.warn("Error " + ex + " exists(" + key + ") on " + set);
+            }
+        }
+
+        return false;
+    }
+
+    public void init(Map config, Map args) {
+        // TODO document configuration
+        propertySets = (List) args.get("PropertySets");
+
+        if (propertySets == null) {
+            propertySets = new ArrayList();
+        }
+    }
+
+    public void remove(String key) throws PropertyException {
+        Iterator i = propertySets.iterator();
+
+        while (i.hasNext()) {
+            PropertySet set = (PropertySet) i.next();
+
+            try {
+                set.remove(key);
+            } catch (PropertyException ex) {
+                if (
+                    //we don't really care about these
+                    log.isDebugEnabled()) {
+                    //we don't really care about these
+                    log.debug("Error removing property " + key + ":" + ex);
+                }
+            }
+        }
+    }
+
+    /**
+     * Attempts to set a property in one of the propertysets.
+     * Note that this method returns at the FIRST successful set call,
+     * rather than setting the same property on all the propertysets.
+     */
+    protected void setImpl(int type, String key, Object value) throws PropertyException {
+        Iterator i = propertySets.iterator();
+
+        while (i.hasNext()) {
+            PropertySet set = (PropertySet) i.next();
+
+            try {
+                if (set.isSettable(key)) {
+                    switch (type) {
+                    case BOOLEAN:
+                        set.setBoolean(key, ((Boolean) value).booleanValue());
+
+                        return;
+
+                    case INT:
+                        set.setInt(key, ((Number) value).intValue());
+
+                        return;
+
+                    case LONG:
+                        set.setLong(key, ((Number) value).longValue());
+
+                        return;
+
+                    case DOUBLE:
+                        set.setDouble(key, ((Number) value).doubleValue());
+
+                        return;
+
+                    case STRING:
+                        set.setString(key, (String) value);
+
+                        return;
+
+                    case TEXT:
+                        set.setText(key, (String) value);
+
+                        return;
+
+                    case DATE:
+                        set.setDate(key, (Date) value);
+
+                        return;
+
+                    case OBJECT:
+                        set.setObject(key, value);
+
+                        return;
+
+                    case XML:
+                        set.setXML(key, (Document) value);
+
+                        return;
+
+                    case DATA:
+                        set.setData(key, (byte[]) value);
+
+                        return;
+                    }
+                }
+            } catch (PropertyException ex) {
+                //we don't care about these here, sadly
+            }
+        }
+    }
+
+    protected Object get(int type, String key) throws PropertyException {
+        Iterator i = propertySets.iterator();
+
+        while (i.hasNext()) {
+            PropertySet set = (PropertySet) i.next();
+
+            try {
+                //poo, since set.get() is protected, we have to double back
+                //on ourselves and call getXXX(), which in turn will call get
+                switch (type) {
+                case BOOLEAN:
+
+                    boolean bool = set.getBoolean(key);
+
+                    if (bool) {
+                        return Boolean.TRUE;
+                    }
+
+                    //If we have false, we need to check if it's missing
+                    //property or if it's actually false
+                    if (set.exists(key)) {
+                        return Boolean.FALSE;
+                    }
+
+                    break;
+
+                case INT:
+
+                    int maybeInt = set.getInt(key);
+
+                    if (maybeInt != 0) {
+                        return new Integer(maybeInt);
+                    }
+
+                    break;
+
+                case LONG:
+
+                    long maybeLong = set.getLong(key);
+
+                    if (maybeLong != 0) {
+                        return new Long(maybeLong);
+                    }
+
+                    break;
+
+                case DOUBLE:
+
+                    double maybeDouble = set.getDouble(key);
+
+                    if (maybeDouble != 0) {
+                        return new Double(maybeDouble);
+                    }
+
+                    break;
+
+                case STRING:
+
+                    String string = set.getString(key);
+
+                    if (string != null) {
+                        return string;
+                    }
+
+                    break;
+
+                case TEXT:
+
+                    String text = set.getText(key);
+
+                    if (text != null) {
+                        return text;
+                    }
+
+                    break;
+
+                case DATE:
+
+                    Date date = set.getDate(key);
+
+                    if (date != null) {
+                        return date;
+                    }
+
+                    break;
+
+                case OBJECT:
+
+                    Object obj = set.getObject(key);
+
+                    if (obj != null) {
+                        return obj;
+                    }
+
+                    break;
+
+                case XML:
+
+                    Document doc = set.getXML(key);
+
+                    if (doc != null) {
+                        return doc;
+                    }
+
+                    break;
+
+                case DATA:
+
+                    byte[] data = set.getData(key);
+
+                    if (data != null) {
+                        return data;
+                    }
+
+                    break;
+
+                case PROPERTIES:
+
+                    Properties p = set.getProperties(key);
+
+                    if (p != null) {
+                        return p;
+                    }
+
+                    break;
+                }
+            } catch (PropertyException ex) {
+                //we don't really care about these here
+            }
+        }
+
+        return null;
+    }
+}

src/java/com/opensymphony/module/propertyset/memory/MemoryPropertySet.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset.memory;
+
+
+/* ====================================================================
+ * The OpenSymphony Software License, Version 1.1
+ *
+ * (this license is derived and fully compatible with the Apache Software
+ * License - see http://www.apache.org/LICENSE.txt)
+ *
+ * Copyright (c) 2001 The OpenSymphony Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        OpenSymphony Group (http://www.opensymphony.com/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "OpenSymphony" and "The OpenSymphony Group"
+ *    must not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact license@opensymphony.com .
+ *
+ * 5. Products derived from this software may not be called "OpenSymphony"
+ *    or "OSCore", nor may "OpenSymphony" or "OSCore" appear in their
+ *    name, without prior written permission of the OpenSymphony Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ */
+import com.opensymphony.module.propertyset.*;
+
+import java.io.Serializable;
+
+import java.util.*;
+
+
+/**
+ * The MemoryPropertySet is a PropertySet implementation that
+ * will store any primitive or object in an internal Map
+ * that is stored in memory.
+ *
+ * <p>An alternative to MemoryPropertySet is SerializablePropertySet
+ * which can be Serialized to/from a stream.</p>
+ *
+ * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
+ * @version $Revision$
+ *
+ * @see com.opensymphony.module.propertyset.PropertySet
+ */
+public class MemoryPropertySet extends AbstractPropertySet {
+    //~ Instance fields ////////////////////////////////////////////////////////
+
+    private HashMap map;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public synchronized Collection getKeys(String prefix, int type) {
+        Iterator keys = getMap().keySet().iterator();
+        List result = new LinkedList();
+
+        while (keys.hasNext()) {
+            String key = (String) keys.next();
+
+            if ((prefix == null) || key.startsWith(prefix)) {
+                if (type == 0) {
+                    result.add(key);
+                } else {
+                    ValueEntry v = (ValueEntry) getMap().get(key);
+
+                    if (v.type == type) {
+                        result.add(key);
+                    }
+                }
+            }
+        }
+
+        Collections.sort(result);
+
+        return result;
+    }
+
+    public synchronized int getType(String key) {
+        if (getMap().containsKey(key)) {
+            return ((ValueEntry) getMap().get(key)).type;
+        } else {
+            return 0;
+        }
+    }
+
+    public synchronized boolean exists(String key) {
+        return getType(key) > 0;
+    }
+
+    public void init(Map config, Map args) {
+        map = new HashMap();
+    }
+
+    public synchronized void remove(String key) {
+        getMap().remove(key);
+    }
+
+    protected synchronized void setImpl(int type, String key, Object value) throws DuplicatePropertyKeyException {
+        if (exists(key)) {
+            ValueEntry v = (ValueEntry) getMap().get(key);
+
+            if (v.type != type) {
+                throw new DuplicatePropertyKeyException();
+            }
+
+            v.value = value;
+        } else {
+            getMap().put(key, new ValueEntry(type, value));
+        }
+
+        return;
+    }
+
+    protected HashMap getMap() {
+        return map;
+    }
+
+    protected synchronized Object get(int type, String key) throws InvalidPropertyTypeException {
+        if (exists(key)) {
+            ValueEntry v = (ValueEntry) getMap().get(key);
+
+            if (v.type != type) {
+                throw new InvalidPropertyTypeException();
+            }
+
+            return v.value;
+        } else {
+            return null;
+        }
+    }
+
+    //~ Inner Classes //////////////////////////////////////////////////////////
+
+    public static final class ValueEntry implements Serializable {
+        Object value;
+        int type;
+
+        public ValueEntry() {
+        }
+
+        public ValueEntry(int type, Object value) {
+            this.type = type;
+            this.value = value;
+        }
+
+        public void setType(int type) {
+            this.type = type;
+        }
+
+        public void setValue(Object value) {
+            this.value = value;
+        }
+    }
+}

src/java/com/opensymphony/module/propertyset/ofbiz/DataPropertyHandler.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.module.propertyset.ofbiz;
+
+import com.opensymphony.module.propertyset.*;
+
+import com.opensymphony.util.Data;
+import com.opensymphony.util.XMLUtils;
+
+import org.w3c.dom.Document;
+
+import java.io.*;
+
+import java.util.Properties;
+
+
+/**
+ * @author <a href="mailto:salaman@qoretech.com">Victor Salaman</a>
+ * $Revision$