checkTypeDeclaration(EObject TypeDeclaration) {
EPackage dom = EPackage.Registry.INSTANCE.getEPackage("org.amma.dsl.jdt.dom");
EClass typeDeclarationClass = (EClass) dom.getEClassifier("TypeDeclaration");
EClass methodDeclarationClass = (EClass) dom.getEClassifier("MethodDeclaration");
EClass simpleNameClass = (EClass) dom.getEClassifier("SimpleName");
OCL<?, EClassifier, ?, ?, ?, ?, ?, ?, ?, Constraint, EClass, EObject> ocl;
ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE);
EObject nameObj = (EObject) typeDeclaration.eGet(typeDeclarationClass.getEStructuralFeature("name"));
String name = (String) nameObj.eGet(simpleNameClass.getEStructuralFeature("fullyQualifiedName"));
OCLHelper<EClassifier, ?, ?, Constraint> helper = ocl.createOCLHelper();
helper.setContext(typeDeclarationClass);
OCLExpression<EClassifier> query = helper.createQuery("self.bodyDeclarations->exists(md : BodyDeclaration | md.oclAsType(MethodDeclaration).returnType.oclAsType(SimpleType).name.oclAsType(SimpleName).fullyQualifiedName = '" + name + "'
and
md.oclAsType(MethodDeclaration).modifiers.exists(m : ExtendedModifier | m.oclAsType(Modifier)._static)
and
md.oclAsType(MethodDeclaration).modifiers.exists(m : ExtendedModifier | m.oclAsType(Modifier).public))");
Query<EClassifier, EClass, EObject> eval = ocl.createQuery(query);
Object oclResult = eval.evaluate(typeDeclaration);
if (oclResult instanceof Boolean && ((Boolean) oclResult))
System.out.println(name);
}