Author: DartPeng
Date: 2010-08-20 04:27:51 -0400 (Fri, 20 Aug 2010)
New Revision: 24325
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreAdapterFactory.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreSwitch.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanAdapterFactory.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanSwitch.java
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/META-INF/MANIFEST.MF
Log:
JBIDE-6776
re-Add java mapping viewer
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/META-INF/MANIFEST.MF
===================================================================
---
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/META-INF/MANIFEST.MF 2010-08-20
08:14:24 UTC (rev 24324)
+++
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/META-INF/MANIFEST.MF 2010-08-20
08:27:51 UTC (rev 24325)
@@ -13,7 +13,9 @@
org.eclipse.emf.edit
Export-Package: org.jboss.tools.smooks.model,
org.jboss.tools.smooks.model.core,
- org.jboss.tools.smooks.model.javabean
+ org.jboss.tools.smooks.model.core.util,
+ org.jboss.tools.smooks.model.javabean,
+ org.jboss.tools.smooks.model.javabean.util
Bundle-ClassPath: .,
libs/commons-beanutils-1.8.3.jar,
libs/commons-beanutils-bean-collections-1.8.3.jar,
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreAdapterFactory.java
===================================================================
---
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreAdapterFactory.java
(rev 0)
+++
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreAdapterFactory.java 2010-08-20
08:27:51 UTC (rev 24325)
@@ -0,0 +1,181 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.model.core.util;
+
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.jboss.tools.smooks.model.core.GlobalParams;
+import org.jboss.tools.smooks.model.core.IComponent;
+import org.jboss.tools.smooks.model.core.ICorePackage;
+import org.jboss.tools.smooks.model.core.IParam;
+import org.jboss.tools.smooks.model.core.IParams;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the
model.
+ * <!-- end-user-doc -->
+ * @see core.CorePackage
+ * @generated
+ */
+public class CoreAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static ICorePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CoreAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = ICorePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the
model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CoreSwitch<Adapter> modelSwitch =
+ new CoreSwitch<Adapter>() {
+
+ @Override
+ public Adapter caseParam(IParam object) {
+ return createParamAdapter();
+ }
+ @Override
+ public Adapter caseParams(IParams object) {
+ return createParamsAdapter();
+ }
+ @Override
+ public Adapter caseGlobalParams(GlobalParams object) {
+ return createGlobalParamsAdapter();
+ }
+ @Override
+ public Adapter caseComponent(IComponent object) {
+ return createComponentAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link core.Param
<em>Param</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see core.Param
+ * @generated
+ */
+ public Adapter createParamAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link core.Params
<em>Params</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see core.Params
+ * @generated
+ */
+ public Adapter createParamsAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link core.GlobalParams
<em>Global Params</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see core.GlobalParams
+ * @generated
+ */
+ public Adapter createGlobalParamsAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link core.Component
<em>Component</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see core.Component
+ * @generated
+ */
+ public Adapter createComponentAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //CoreAdapterFactory
Property changes on:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreSwitch.java
===================================================================
---
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreSwitch.java
(rev 0)
+++
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreSwitch.java 2010-08-20
08:27:51 UTC (rev 24325)
@@ -0,0 +1,197 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.model.core.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.jboss.tools.smooks.model.core.GlobalParams;
+import org.jboss.tools.smooks.model.core.IComponent;
+import org.jboss.tools.smooks.model.core.ICorePackage;
+import org.jboss.tools.smooks.model.core.IParam;
+import org.jboss.tools.smooks.model.core.IParams;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see core.CorePackage
+ * @generated
+ */
+public class CoreSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static ICorePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CoreSwitch() {
+ if (modelPackage == null) {
+ modelPackage = ICorePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code>
call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code>
call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code>
call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case ICorePackage.PARAM: {
+ IParam param = (IParam)theEObject;
+ T result = caseParam(param);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case ICorePackage.PARAMS: {
+ IParams params = (IParams)theEObject;
+ T result = caseParams(params);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case ICorePackage.GLOBAL_PARAMS: {
+ GlobalParams globalParams = (GlobalParams)theEObject;
+ T result = caseGlobalParams(globalParams);
+ if (result == null) result = caseParams(globalParams);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case ICorePackage.COMPONENT: {
+ IComponent component = (IComponent)theEObject;
+ T result = caseComponent(component);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Param</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Param</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParam(IParam object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Params</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Params</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseParams(IParams object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Global
Params</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Global
Params</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseGlobalParams(GlobalParams object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Component</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Component</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseComponent(IComponent object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case
anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //CoreSwitch
Property changes on:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/core/util/CoreSwitch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanAdapterFactory.java
===================================================================
---
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanAdapterFactory.java
(rev 0)
+++
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanAdapterFactory.java 2010-08-20
08:27:51 UTC (rev 24325)
@@ -0,0 +1,218 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.model.javabean.util;
+
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.jboss.tools.smooks.model.core.IComponent;
+import org.jboss.tools.smooks.model.javabean.IBean;
+import org.jboss.tools.smooks.model.javabean.IDecodeParam;
+import org.jboss.tools.smooks.model.javabean.IExpression;
+import org.jboss.tools.smooks.model.javabean.IJavaBeanPackage;
+import org.jboss.tools.smooks.model.javabean.IValue;
+import org.jboss.tools.smooks.model.javabean.IWiring;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the
model.
+ * <!-- end-user-doc -->
+ * @see javabean.JavabeanPackage
+ * @generated
+ */
+public class JavabeanAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static IJavaBeanPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public JavabeanAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = IJavaBeanPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the
model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected JavabeanSwitch<Adapter> modelSwitch =
+ new JavabeanSwitch<Adapter>() {
+ @Override
+ public Adapter caseDecodeParam(IDecodeParam object) {
+ return createDecodeParamAdapter();
+ }
+ @Override
+ public Adapter caseWiring(IWiring object) {
+ return createWiringAdapter();
+ }
+ @Override
+ public Adapter caseExpression(IExpression object) {
+ return createExpressionAdapter();
+ }
+ @Override
+ public Adapter caseValue(IValue object) {
+ return createValueAdapter();
+ }
+ @Override
+ public Adapter caseBean(IBean object) {
+ return createBeanAdapter();
+ }
+ @Override
+ public Adapter caseComponent(IComponent object) {
+ return createComponentAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link javabean.DecodeParam
<em>Decode Param</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see javabean.DecodeParam
+ * @generated
+ */
+ public Adapter createDecodeParamAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link javabean.Wiring
<em>Wiring</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see javabean.Wiring
+ * @generated
+ */
+ public Adapter createWiringAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link javabean.Expression
<em>Expression</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see javabean.Expression
+ * @generated
+ */
+ public Adapter createExpressionAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link javabean.Value
<em>Value</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see javabean.Value
+ * @generated
+ */
+ public Adapter createValueAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link javabean.Bean
<em>Bean</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see javabean.Bean
+ * @generated
+ */
+ public Adapter createBeanAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link core.Component
<em>Component</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see core.Component
+ * @generated
+ */
+ public Adapter createComponentAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //JavabeanAdapterFactory
Property changes on:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanAdapterFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanSwitch.java
===================================================================
---
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanSwitch.java
(rev 0)
+++
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanSwitch.java 2010-08-20
08:27:51 UTC (rev 24325)
@@ -0,0 +1,237 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.jboss.tools.smooks.model.javabean.util;
+
+
+import java.util.List;
+
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.jboss.tools.smooks.model.core.IComponent;
+import org.jboss.tools.smooks.model.javabean.IBean;
+import org.jboss.tools.smooks.model.javabean.IDecodeParam;
+import org.jboss.tools.smooks.model.javabean.IExpression;
+import org.jboss.tools.smooks.model.javabean.IJavaBeanPackage;
+import org.jboss.tools.smooks.model.javabean.IValue;
+import org.jboss.tools.smooks.model.javabean.IWiring;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see javabean.JavabeanPackage
+ * @generated
+ */
+public class JavabeanSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static IJavaBeanPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public JavabeanSwitch() {
+ if (modelPackage == null) {
+ modelPackage = IJavaBeanPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code>
call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code>
call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns
a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code>
call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case IJavaBeanPackage.DECODE_PARAM: {
+ IDecodeParam decodeParam = (IDecodeParam)theEObject;
+ T result = caseDecodeParam(decodeParam);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case IJavaBeanPackage.WIRING: {
+ IWiring wiring = (IWiring)theEObject;
+ T result = caseWiring(wiring);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case IJavaBeanPackage.EXPRESSION: {
+ IExpression expression = (IExpression)theEObject;
+ T result = caseExpression(expression);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case IJavaBeanPackage.VALUE: {
+ IValue value = (IValue)theEObject;
+ T result = caseValue(value);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case IJavaBeanPackage.BEAN: {
+ IBean bean = (IBean)theEObject;
+ T result = caseBean(bean);
+ if (result == null) result = caseComponent(bean);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Decode
Param</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Decode
Param</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDecodeParam(IDecodeParam object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Wiring</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Wiring</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseWiring(IWiring object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Expression</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Expression</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseExpression(IExpression object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Value</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Value</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseValue(IValue object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Bean</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Bean</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseBean(IBean object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>Component</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>Component</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseComponent(IComponent object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of
'<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case
anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of
'<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //JavabeanSwitch
Property changes on:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/javabean/util/JavabeanSwitch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date