Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java101
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/BehaviorValidationVisitor.java83
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ClientBehaviorRendererValidationVisitor.java76
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java1
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java181
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java3
6 files changed, 443 insertions, 2 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java
index 98b3611e7..e38d92fdd 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ApplicationValidationVisitor.java
@@ -57,7 +57,11 @@ public class ApplicationValidationVisitor extends EObjectValidationVisitor
new PropertyResolverValidationVisitor(getVersion()),
new VariableResolverValidationVisitor(getVersion()),
new ELResolverValidationVisitor(getVersion()),
- new LocaleConfigValidationVisitor(getVersion())
+ new LocaleConfigValidationVisitor(getVersion()),
+// new PartialTraversalValidationVisitor(getVersion()),
+ new ResourceHandlerValidationVisitor(getVersion()),
+ new SystemEventListenerTypeValidationVisitor(getVersion()),
+ new DefaultValidatorsValidationVisitor(getVersion())
};
}
@@ -295,5 +299,100 @@ public class ApplicationValidationVisitor extends EObjectValidationVisitor
return _instanceOf;
}
}
+
+// private static class PartialTraversalValidationVisitor extends ApplicationClassNameBasedValidationVisitor
+// {
+// PartialTraversalValidationVisitor(final String version)
+// {
+// super(FacesConfigPackage.eINSTANCE.getApplicationType_PartialTraversal(),
+// version,"javax.faces.application.PartialTraversal", true); //$NON-NLS-1$
+// }
+// }
+
+ private static class ResourceHandlerValidationVisitor extends ApplicationClassNameBasedValidationVisitor
+ {
+ ResourceHandlerValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getApplicationType_ResourceHandler(),
+ version,"javax.faces.application.ResourceHandler", true); //$NON-NLS-1$
+ }
+ }
+
+// private static class PartialTraversalValidationVisitor extends ApplicationClassNameBasedValidationVisitor
+// {
+// PartialTraversalValidationVisitor(final String version)
+// {
+// super(FacesConfigPackage.eINSTANCE.getApplicationType_PartialTraversal(),
+// version,"javax.faces.application.PartialTraversal", true); //$NON-NLS-1$
+// }
+// }
+
+ private static class SystemEventListenerTypeValidationVisitor extends EObjectValidationVisitor
+ {
+ SystemEventListenerTypeValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getApplicationType_SystemEventListener(),
+ version);
+ }
+
+ @Override
+ protected void doValidate(final EObject eObject, final List messages, final IFile file) {
+ //validation takes place with childNodeValidators
+ }
+
+ @Override
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ return new EObjectValidationVisitor[]{
+ new SystemEventListenerValidationVisitor(getVersion()),
+ new SystemEventListenerClassValidationVisitor(getVersion()),
+ new SystemEventListenerSourceClassValidationVisitor(getVersion())
+ };
+ }
+ }
+ private static class DefaultValidatorsValidationVisitor extends EObjectValidationVisitor
+ {
+ DefaultValidatorsValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getApplicationType_DefaultValidators(),
+ version);
+ }
+
+ @Override
+ protected void doValidate(final EObject eObject, final List messages, final IFile file) {
+ //do nothing here... we should validate the ValidateIDType below
+ }
+
+ @Override
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ //TODO - validate the ValidateIDTypes
+ return NO_CHILDREN;
+ }
+ }
+
+ private static class SystemEventListenerValidationVisitor extends ApplicationClassNameBasedValidationVisitor {
+
+ SystemEventListenerValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getSystemEventListenerType_SystemEventListenerClass(),
+ version,"javax.faces.event.SystemEventListener", true); //$NON-NLS-1$
+ }
+ }
+
+ private static class SystemEventListenerClassValidationVisitor extends ApplicationClassNameBasedValidationVisitor {
+
+ SystemEventListenerClassValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getSystemEventListenerType_SystemEventClass(),
+ version,"javax.faces.event.SystemEvent", true); //$NON-NLS-1$
+ }
+ }
+
+ private static class SystemEventListenerSourceClassValidationVisitor extends ApplicationClassNameBasedValidationVisitor {
+ SystemEventListenerSourceClassValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getSystemEventListenerType_SourceClass(),
+ version,"java.lang.Object", true); //$NON-NLS-1$
+ }
+ }
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/BehaviorValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/BehaviorValidationVisitor.java
new file mode 100644
index 000000000..c7f73c587
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/BehaviorValidationVisitor.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2010 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.validation.internal.appconfig;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jst.jsf.facesconfig.emf.BehaviorClassType;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
+
+/**
+ * Validates the behavior
+ */
+public class BehaviorValidationVisitor extends EObjectValidationVisitor
+{
+
+ /**
+ * @param version
+ */
+ public BehaviorValidationVisitor(String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getFacesConfigType_Behavior()
+ ,version);
+ }
+
+ protected void doValidate(EObject object, List messages, IFile file)
+ {
+ // nothing to do
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators()
+ {
+ return new EObjectValidationVisitor[]
+ {
+ new BehaviorClassValidationVisitor(getVersion()),
+ new AttributeValidationVisitor(FacesConfigPackage.eINSTANCE.getBehaviorType_Attribute(), getVersion()),
+ new PropertyValidationVisitor
+ (FacesConfigPackage.eINSTANCE.getBehaviorType_Property()
+ ,FacesConfigPackage.eINSTANCE.getBehaviorType_BehaviorClass()
+ ,getVersion())
+ };
+ }
+
+ private static class BehaviorClassValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ /**
+ * @param version
+ */
+ public BehaviorClassValidationVisitor(String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getBehaviorType_BehaviorClass()
+ , version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((BehaviorClassType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.component.behavior.Behavior"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ClientBehaviorRendererValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ClientBehaviorRendererValidationVisitor.java
new file mode 100644
index 000000000..7eb966db9
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/ClientBehaviorRendererValidationVisitor.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2010 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsf.validation.internal.appconfig;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jst.jsf.facesconfig.emf.ClientBehaviorRendererClassType;
+import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
+
+/**
+ * ClientBehaviorRenderer validation
+ *
+ */
+public class ClientBehaviorRendererValidationVisitor extends EObjectValidationVisitor {
+
+ /**
+ * @param version
+ */
+ public ClientBehaviorRendererValidationVisitor(String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getRenderKitType_ClientBehaviorRenderer(),
+ version);
+ }
+
+ protected void doValidate(EObject object, List messages, IFile file) {
+ // nothing to do
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ return new EObjectValidationVisitor[]
+ {
+ new ClientBehaviorRendererClassValidationVisitor(getVersion())
+ };
+ }
+
+ private static class ClientBehaviorRendererClassValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ /**
+ * @param version
+ */
+ public ClientBehaviorRendererClassValidationVisitor(String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getClientBehaviorRendererType_ClientBehaviorRendererClass()
+ , version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((ClientBehaviorRendererClassType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.render.ClientBehaviorRenderer"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
+}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java
index 8916e72bb..5298ecac3 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FacesConfigValidator.java
@@ -47,6 +47,7 @@ public class FacesConfigValidator extends EObjectValidationVisitor
, new ConverterValidationVisitor(getVersion())
, new ManagedBeanValidationVisitor(getVersion())
, new RenderKitValidationVisitor(getVersion())
+ , new BehaviorValidationVisitor(getVersion())
};
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java
index 1be47377e..2f9678c65 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/FactoryValidationVisitor.java
@@ -15,10 +15,16 @@ import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jst.jsf.facesconfig.emf.ApplicationFactoryType;
+import org.eclipse.jst.jsf.facesconfig.emf.ExceptionHandlerFactoryType;
+import org.eclipse.jst.jsf.facesconfig.emf.ExternalContextFactoryType;
import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigPackage;
import org.eclipse.jst.jsf.facesconfig.emf.FacesContextFactoryType;
import org.eclipse.jst.jsf.facesconfig.emf.LifecycleFactoryType;
+import org.eclipse.jst.jsf.facesconfig.emf.PartialViewContextFactoryType;
import org.eclipse.jst.jsf.facesconfig.emf.RenderKitFactoryType;
+import org.eclipse.jst.jsf.facesconfig.emf.TagHandlerDelegateFactoryType;
+import org.eclipse.jst.jsf.facesconfig.emf.ViewDeclarationLanguageFactoryType;
+import org.eclipse.jst.jsf.facesconfig.emf.VisitContextFactoryType;
/**
* @author cbateman
@@ -46,6 +52,12 @@ public class FactoryValidationVisitor extends EObjectValidationVisitor
, new FacesContextFactoryValidationVisitor(getVersion())
, new LifecycleFactoryValidationVisitor(getVersion())
, new RenderkitFactoryValidationVisitor(getVersion())
+ , new ExceptionHandlerFactoryValidationVisitor(getVersion())
+ , new ExternalContextFactoryValidationVisitor(getVersion())
+ , new PartialViewContextFactoryValidationVisitor(getVersion())
+ , new ViewDeclarationLanguageFactoryValidationVisitor(getVersion())
+ , new TagHandlerDelegateFactoryValidationVisitor(getVersion())
+ , new VisitContextFactoryValidationVisitor(getVersion())
};
}
@@ -167,4 +179,173 @@ public class FactoryValidationVisitor extends EObjectValidationVisitor
return true;
}
}
+ private static class ExceptionHandlerFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ ExceptionHandlerFactoryValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getFactoryType_ExceptionHandlerFactory(),
+ version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((ExceptionHandlerFactoryType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.context.ExceptionHandlerFactory"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ // none
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
+ private static class ExternalContextFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ ExternalContextFactoryValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getFactoryType_ExternalContextFactory(),
+ version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((ExternalContextFactoryType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.context.ExternalContextFactory"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ // none
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
+
+ private static class ViewDeclarationLanguageFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ ViewDeclarationLanguageFactoryValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getFactoryType_ViewDeclarationLanguageFactory(),
+ version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((ViewDeclarationLanguageFactoryType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.faces.ViewDeclarationLanguageFactory"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ // none
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
+ private static class PartialViewContextFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ PartialViewContextFactoryValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getFactoryType_PartialViewContextFactory(),
+ version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((PartialViewContextFactoryType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.context.PartialViewContextFactory"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ // none
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
+ private static class TagHandlerDelegateFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ TagHandlerDelegateFactoryValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getFactoryType_TagHandlerDelegateFactory(),
+ version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((TagHandlerDelegateFactoryType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.view.facelets.TagHandlerDelegateFactory"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ // none
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
+ private static class VisitContextFactoryValidationVisitor extends ClassNameEObjectValidationVisitor
+ {
+ VisitContextFactoryValidationVisitor(final String version)
+ {
+ super(FacesConfigPackage.eINSTANCE.getFactoryType_VisitContextFactory(),
+ version);
+ }
+
+ protected String getFullyQualifiedName(EObject eobj)
+ {
+ return ((VisitContextFactoryType)eobj).getTextContent();
+ }
+
+ protected String getInstanceOf() {
+ return "javax.faces.component.visit.VisitContextFactory"; //$NON-NLS-1$
+ }
+
+ protected EObjectValidationVisitor[] getChildNodeValidators() {
+ // none
+ return NO_CHILDREN;
+ }
+
+ @Override
+ protected boolean mustBeClass() {
+ // must be a class
+ return true;
+ }
+ }
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java
index caf7d6c08..3252c5853 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/validation/internal/appconfig/RenderKitValidationVisitor.java
@@ -42,7 +42,8 @@ public class RenderKitValidationVisitor extends EObjectValidationVisitor
return new EObjectValidationVisitor[]
{
new RenderKitClassValidationVisitor(getVersion()),
- new RendererValidationVisitor(getVersion())
+ new RendererValidationVisitor(getVersion()),
+ new ClientBehaviorRendererValidationVisitor(getVersion())
};
}

Back to the top