Author: pete.muir(a)jboss.org
Date: 2009-03-15 13:43:03 -0400 (Sun, 15 Mar 2009)
New Revision: 2006
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd
Modified:
ri/trunk/xsd/
ri/trunk/xsd/pom.xml
Log:
move xsd to it's own project
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java 2009-03-15
17:38:52 UTC (rev 2005)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageInfo.java 2009-03-15
17:43:03 UTC (rev 2006)
@@ -1,48 +0,0 @@
-package org.jboss.webbeans.xsd;
-
-import java.util.List;
-
-import org.dom4j.Document;
-
-public class PackageInfo
-{
- private List<String> namespaces;
- private Document schema;
- private String packageName;
-
- public PackageInfo(String packageName)
- {
- this.packageName = packageName;
- }
-
- public List<String> getNamespaces()
- {
- return namespaces;
- }
-
- public void setNamespaces(List<String> namespaces)
- {
- this.namespaces = namespaces;
- }
-
- public Document getSchema()
- {
- return schema;
- }
-
- public void setSchema(Document schema)
- {
- this.schema = schema;
- }
-
- public String getPackageName()
- {
- return packageName;
- }
-
- public void setPackageName(String packageName)
- {
- this.packageName = packageName;
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-15
17:38:52 UTC (rev 2005)
+++
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-15
17:43:03 UTC (rev 2006)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.xsd;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.ProcessingEnvironment;
-import javax.annotation.processing.RoundEnvironment;
-import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.annotation.processing.SupportedSourceVersion;
-import javax.lang.model.SourceVersion;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.type.DeclaredType;
-import javax.lang.model.type.TypeKind;
-import javax.lang.model.util.ElementFilter;
-
-import org.jboss.webbeans.xsd.helpers.DataSetter;
-import org.jboss.webbeans.xsd.helpers.XSDHelper;
-import org.jboss.webbeans.xsd.model.ClassModel;
-
-/**
- * An annotation processor that updates the package-level XSD for the packages
- * that have had their files compiled.
- *
- * @author Nicklas Karlsson
- *
- */
-(a)SupportedSourceVersion(SourceVersion.RELEASE_6)
-@SupportedAnnotationTypes("*")
-public class PackageSchemaGenerator extends AbstractProcessor
-{
- // A helper for the XSD operations
- XSDHelper helper;
-
- @Override
- public synchronized void init(ProcessingEnvironment processingEnv)
- {
- super.init(processingEnv);
- helper = new XSDHelper(processingEnv.getFiler());
- }
-
- @Override
- public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
roundEnv)
- {
- List<ClassModel> workingSet = new ArrayList<ClassModel>();
- // Iterates over the classes compiled, creates a model of the classes and
- // add them to a working set
- for (Element element : roundEnv.getRootElements())
- {
- workingSet.add(inspectClass(element));
- }
- if (!roundEnv.processingOver())
- {
- // Update the package XSDs for the files changed
- helper.updateSchemas(workingSet);
- // And flush the changes to disk
- helper.writeSchemas();
- }
- return false;
- }
-
- /**
- * Creates a class model from a class element
- *
- * @param element The element to analyze
- * @return The class model
- */
- private ClassModel inspectClass(Element element)
- {
- TypeElement typeElement = (TypeElement) element;
- ClassModel classModel = new ClassModel();
-
- // If the class has superclass's, scan them recursively
- if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
- {
- inspectClass(((DeclaredType) typeElement.getSuperclass()).asElement());
- }
-
- // Gets the parent from the cache. We know it's there since we has scanned
- // the
- // hierarchy already
- ClassModel parent =
helper.getCachedClassModel(typeElement.getSuperclass().toString());
- // Populate the class level info (name, parent etc)
- DataSetter.populateClassModel(classModel, element, parent);
- // Filter out the fields and populate the model
- for (Element field : ElementFilter.fieldsIn(element.getEnclosedElements()))
- {
- DataSetter.populateFieldModel(classModel, field);
- }
- // Filter out the methods and populate the model
- for (Element method : ElementFilter.methodsIn(element.getEnclosedElements()))
- {
- DataSetter.populateMethodModel(classModel, method);
- }
- // Filter out the constructors and populate the model
- for (Element constructor :
ElementFilter.constructorsIn(element.getEnclosedElements()))
- {
- DataSetter.populateMethodModel(classModel, constructor);
- }
- // Place the new class model in the cache
- helper.cacheClassModel(classModel);
- return classModel;
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd 2009-03-15
17:38:52 UTC (rev 2005)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd 2009-03-15
17:43:03 UTC (rev 2006)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- targetNamespace="urn:java:com.acme.foo"
- xmlns:foo="urn:java:com.acme.foo"
- xmlns:ee="urn:java:ee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema.xsd"
- >
-
- <xs:element name="Foo">
- <xs:complexType>
- <xs:choice>
- <!-- Options to allow people to declare this class a binding type or
stereotype - TODO only if an annotation -->
- <xs:element ref="ee:BindingType"/>
- <xs:element ref="ee:StereotypType"/>
- <!-- Somehow import all binding types known etc. to give people that option
-->
- <xs:any /> <!-- Can't guess all types people want to put here
-->
- </xs:choice>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="Bar">
-
- </xs:element>
-
-
-</xs:schema>
\ No newline at end of file
Property changes on: ri/trunk/xsd
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
Modified: ri/trunk/xsd/pom.xml
===================================================================
--- ri/trunk/xsd/pom.xml 2009-03-15 17:38:52 UTC (rev 2005)
+++ ri/trunk/xsd/pom.xml 2009-03-15 17:43:03 UTC (rev 2006)
@@ -44,6 +44,14 @@
<build>
<defaultGoal>install</defaultGoal>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
</plugins>
</build>