[jboss-svn-commits] JBoss Common SVN: r4019 - jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Feb 9 12:48:45 EST 2010


Author: alex.loubyansky at jboss.com
Date: 2010-02-09 12:48:44 -0500 (Tue, 09 Feb 2010)
New Revision: 4019

Added:
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/SetParentOverrideHandler.java
Log:
missed from the previous commit

Added: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/SetParentOverrideHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/SetParentOverrideHandler.java	                        (rev 0)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/SetParentOverrideHandler.java	2010-02-09 17:48:44 UTC (rev 4019)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.xb.builder.runtime;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler;
+import org.xml.sax.Attributes;
+
+/**
+ * A SetParentOverrideHandler.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class SetParentOverrideHandler implements ParticleHandler
+{
+   protected ParticleHandler delegate;
+   protected AbstractPropertyHandler propHandler;
+   
+   public SetParentOverrideHandler(ParticleHandler delegate, AbstractPropertyHandler propHandler)
+   {
+      if(delegate == null)
+         throw new IllegalArgumentException("delegate must not be null.");
+      if(propHandler == null)
+         throw new IllegalArgumentException("property handler must not be null.");
+      this.delegate = delegate;
+      this.propHandler = propHandler;
+   }
+   
+   public Object endParticle(Object o, QName elementName, ParticleBinding particle)
+   {
+      return delegate.endParticle(o, elementName, particle);
+   }
+
+   public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle)
+   {
+      propHandler.doHandle(parent, o, elementName);
+   }
+
+   public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs,
+         NamespaceContext nsCtx)
+   {
+      return delegate.startParticle(parent, elementName, particle, attrs, nsCtx);
+   }
+}



More information about the jboss-svn-commits mailing list