Author: alexsmirnov
Date: 2009-12-28 20:12:41 -0500 (Mon, 28 Dec 2009)
New Revision: 16217
Modified:
root/cdk/trunk/plugins/generator/pom.xml
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Mergeable.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java
Log:
set proper order of faces-config elements.
Modified: root/cdk/trunk/plugins/generator/pom.xml
===================================================================
--- root/cdk/trunk/plugins/generator/pom.xml 2009-12-29 01:12:10 UTC (rev 16216)
+++ root/cdk/trunk/plugins/generator/pom.xml 2009-12-29 01:12:41 UTC (rev 16217)
@@ -120,13 +120,16 @@
<artifactId>xinclude</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
- <!--
- <dependency> <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId> <version>2.1</version>
- </dependency> <dependency>
<groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId> <version>2.1.10</version>
- </dependency>
- -->
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.2</version>
+ </dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -33,6 +33,7 @@
import javax.faces.event.FacesEvent;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.MirroredTypeException;
import javax.lang.model.type.MirroredTypesException;
import javax.lang.model.type.TypeMirror;
@@ -232,9 +233,10 @@
} catch (MirroredTypesException mirror) {
for (TypeMirror eventType : mirror.getTypeMirrors()) {
component.addEvent(eventType.toString());
-
// TODO - check does component already implement eventSource
interface
}
+ } catch (MirroredTypeException mirror) {
+ component.addEvent(mirror.getTypeMirror().toString());
}
}
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -72,6 +72,12 @@
return visitor.visit(this, param);
}
+ @Override
+ public boolean same(Behavior other) {
+ return null != getType() && getType().equals(other.getType());
+ }
+
+
public static final class Type extends Key {
public Type(String name) {
super(name);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorRenderer.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -87,6 +87,18 @@
return visitor.visit(this, param);
}
+ @Override
+ public boolean same(BehaviorRenderer other) {
+ if(null != getType() && null != other.getType()){
+ // Both types not null, compare them.
+ return getType().equals(other.getType());
+ }
+ // one or both types are null, compare classes.
+ if(null != getRendererClass() &&
getRendererClass().equals(other.getRendererClass())){
+ return true;
+ }
+ return false;
+ }
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -103,6 +103,18 @@
ComponentLibrary.merge(this, otherComponent);
}
+ @Override
+ public boolean same(Component other) {
+ if(null != getType() && null != other.getType()){
+ // Both types not null, compare them.
+ return getType().equals(other.getType());
+ }
+ // one or both types are null, compare classes.
+ if(null != getComponentClass() &&
getComponentClass().equals(other.getComponentClass())){
+ return true;
+ }
+ return false;
+ }
/**
* <p class="changed_added_4_0"></p>
* @param type the type to set
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -64,6 +64,12 @@
public void merge(Converter other) {
}
+ @Override
+ public boolean same(Converter other) {
+ return null != getType() && getType().equals(other.getType());
+ }
+
+
public static final class Type extends Key {
public Type(String name) {
super(name);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/DescriptionGroup.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -69,7 +69,7 @@
*
* @author asmirnov(a)exadel.com
*/
- @XmlType(name = "icon-type", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ @XmlType(name = "iconType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,propOrder={"smallIcon","largeIcon"})
public static final class Icon {
private String largeIcon;
private String smallIcon;
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -136,4 +136,10 @@
public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
return visitor.visit(this, param);
}
+
+ @Override
+ public boolean same(Event other) {
+ return null != getType() && getType().equals(other.getType());
+ }
+
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -68,4 +68,9 @@
public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
return visitor.visit(this, param);
}
+
+ @Override
+ public boolean same(Facet other) {
+ return equals(other);
+ }
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -73,6 +73,12 @@
// TODO Auto-generated method stub
}
+
+ @Override
+ public boolean same(Listener other) {
+ return equals(other);
+ }
+
public static final class Type extends Key {
public Type(String name) {
super(name);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Mergeable.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Mergeable.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Mergeable.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -1,5 +1,17 @@
package org.richfaces.cdk.model;
public interface Mergeable<T> {
+ /**
+ * <p class="changed_added_4_0">Merge values from other
object.</p>
+ * @param other
+ */
public void merge(T other);
+
+ /**
+ * <p class="changed_added_4_0">Compare object with other. For
example, JSF component with same type or
+ * class is the same component.</p>
+ * @param other
+ * @return
+ */
+ public boolean same(T other);
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelCollection.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.cdk.model;
import java.util.Collection;
@@ -38,18 +36,18 @@
/**
* <p class="changed_added_4_0">
- * Base class for all model collections.
+ * Base class for all model collections. This collection use {@link
Mergeable#same(Object)} method instead of equals
+ * to lookup objects in the {@link #contains(Object)} and {@link #remove(Object)}
methods. In addition, it merges same objects instead of replace in the {@link
#add(ModelElement)} method.
* </p>
- *
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
-public class ModelCollection<E extends ModelElement<? super E>>
- implements Collection<E>, Visitable {
+public class ModelCollection<E extends ModelElement<? super E>> implements
Collection<E>, Visitable {
private final List<E> elements = Lists.newArrayList();
- public static <T extends ModelElement<? super T>>
ModelCollection<T> create(){
+ public static <T extends ModelElement<? super T>>
ModelCollection<T> create() {
return new ModelCollection<T>();
}
@@ -66,7 +64,15 @@
@Override
public boolean add(E e) {
- // TODO - merge instead of add ???
+ if(null == e){
+ throw new NullPointerException();
+ }
+ for (E element : elements) {
+ if (element.same(e)) {
+ element.merge(e);
+ return false;
+ }
+ }
return elements.add(e);
}
@@ -89,8 +95,13 @@
@SuppressWarnings("unchecked")
@Override
public boolean contains(Object o) {
- if (o instanceof ModelElement<?>) {
- return elements.contains(o);
+ if (null != o) {
+ Class<? extends Object> clazz = o.getClass();
+ for (E element : elements) {
+ if (clazz.isInstance(element) && element.same((E) o)) {
+ return true;
+ }
+ }
}
return false;
}
@@ -112,7 +123,17 @@
@Override
public boolean remove(Object o) {
- return elements.remove(o);
+ if (null != o) {
+ Class<? extends Object> clazz = o.getClass();
+ for (E element : elements) {
+ if (clazz.isInstance(element) && element.same((E) o)) {
+ elements.remove(element);
+ return true;
+ }
+ }
+
+ }
+ return false;
}
@Override
@@ -157,5 +178,4 @@
return result;
}
-
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -270,4 +270,9 @@
public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws
CdkException {
return visitor.visit(this, param);
}
+
+ @Override
+ public boolean same(Property other) {
+ return this == other;
+ }
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -97,6 +97,12 @@
}
+ @Override
+ public boolean same(RenderKit other) {
+ return null != getRenderKitClass() &&
getRenderKitClass().equals(other.getRenderKitClass());
+ }
+
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -179,6 +179,23 @@
ComponentLibrary.merge(this, other);
}
+ @Override
+ public boolean same(Renderer other) {
+ if(null != getType() && null != other.getType()){
+ // compare families ?
+ if(null != getFamily() && null != other.getFamily() &&
!getFamily().equals(other.getFamily())){
+ return false;
+ }
+ // Both types not null, compare them.
+ return getType().equals(other.getType());
+ }
+ // one or both types are null, compare classes.
+ if(null != getRendererClass()&&
getRendererClass().equals(other.getRendererClass())){
+ return true;
+ }
+ return false;
+ }
+
/**
* <p class="changed_added_4_0">Key for lookup renderer in the
model.</p>
* @author asmirnov(a)exadel.com
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -74,6 +74,12 @@
// TODO Auto-generated method stub
}
+
+ @Override
+ public boolean same(Validator other) {
+ return null != getType() && getType().equals(other.getType());
+ }
+
public static final class Type extends Key {
public Type(String name) {
super(name);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/FacesConfigNamespacePreffixMapper.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -25,14 +25,14 @@
import org.richfaces.cdk.model.ComponentLibrary;
-/*import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper;*/
+import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
/**
* <p class="changed_added_4_0"></p>
*
* @author asmirnov(a)exadel.com
*/
-public class FacesConfigNamespacePreffixMapper /* extends NamespacePrefixMapper */ {
+public class FacesConfigNamespacePreffixMapper extends NamespacePrefixMapper {
/*
* (non-Javadoc)
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -204,7 +204,7 @@
if (null != schemaLocation) {
marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, schemaLocation);
-//
marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",
PREFFIX_MAPPER);
+
marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",
PREFFIX_MAPPER);
}
marshaller.marshal(model, output);
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/AttributeBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -24,6 +24,8 @@
package org.richfaces.cdk.xmlconfig.model;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -33,6 +35,8 @@
*
* @author asmirnov(a)exadel.com
*/
+@XmlType(name="faces-config-attributeType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE,
+
propOrder={"key","type","defaultValue","suggestedValue","extension"})
public class AttributeBean extends PropertyBase {
/**
@@ -40,21 +44,18 @@
*
* @return the name
*/
- @XmlElement(name = "attribute-name", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
- public String getName() {
+ @XmlElement(name = "attribute-name", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,required=true)
+ public String getKey() {
return super.getKey();
}
-
- public void setName(String name) {
- super.setKey(name);
- }
/**
* <p class="changed_added_4_0"></p>
*
* @return the type
*/
- @XmlElement(name = "attribute-class", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ @XmlElement(name = "attribute-class", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,required=true)
+ @XmlJavaTypeAdapter(ClassAdapter.class)
public ClassDescription getType() {
return super.getType();
}
@@ -66,6 +67,29 @@
}
@Override
+ @XmlElement(name = "default-value", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ public String getDefaultValue() {
+ return super.getDefaultValue();
+ }
+
+ @Override
+ public void setDefaultValue(String defaultValue) {
+ super.setDefaultValue(defaultValue);
+ }
+
+ @Override
+ @XmlElement(name = "suggested-value", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ public String getSuggestedValue() {
+ return super.getSuggestedValue();
+ }
+
+
+ @Override
+ public void setSuggestedValue(String suggestedValue) {
+ super.setSuggestedValue(suggestedValue);
+ }
+
+ @Override
@XmlElement(name = "attribute-extension", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
public PropertyExtension getExtension() {
return super.getExtension();
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -42,7 +42,9 @@
*
* @author asmirnov(a)exadel.com
*/
-@XmlType(name = "faces-config-componentType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+@XmlType(name = "faces-config-componentType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,
+ propOrder={"type", "componentClass", "facets",
+ "attributes", "extension"})
@XmlJavaTypeAdapter(ComponentAdapter.class)
public class ComponentBean extends ExtensibleBean<ComponentBean.ComponentExtension>
{
private List<PropertyBase> attributes = Lists.newArrayList();
@@ -55,7 +57,7 @@
*
* @return the type
*/
- @XmlElement(name = "component-type", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ @XmlElement(name = "component-type", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,required=true)
public String getType() {
return type;
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/DescriptionGroupBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -1,10 +1,13 @@
package org.richfaces.cdk.xmlconfig.model;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.DescriptionGroup;
+@XmlType(name="descriptionType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE,
+ propOrder={"description","displayname","icon"})
public class DescriptionGroupBean implements DescriptionGroup {
private String description;
private String displayname;
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/FacesConfigBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -28,6 +28,7 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.Component;
@@ -44,13 +45,18 @@
* @author asmirnov(a)exadel.com
*/
@XmlRootElement(name = "faces-config", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+@XmlType(name="faces-configType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE)
public class FacesConfigBean implements
Extensible<FacesConfigBean.FacesConfigExtension> {
@XmlElement(name = "component", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
@XmlJavaTypeAdapter(ComponentAdapter.class)
private List<Component> components = Lists.newArrayList();
@XmlElement(name = "render-kit", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
private List<RenderKitBean> renderKits = Lists.newArrayList();
+ @XmlAttribute
private String version = "2.0";
+ @XmlAttribute(name="metadata-complete")
+ private boolean metadataComplete;
+ @XmlElement(name = "faces-config-extension", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
private FacesConfigExtension extension;
/**
@@ -58,7 +64,6 @@
*
* @return the version
*/
- @XmlAttribute
public String getVersion() {
return version;
}
@@ -74,6 +79,22 @@
/**
* <p class="changed_added_4_0"></p>
+ * @return the metadataComplete
+ */
+ public boolean isMetadataComplete() {
+ return this.metadataComplete;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param metadataComplete the metadataComplete to set
+ */
+ public void setMetadataComplete(boolean metadataComplete) {
+ this.metadataComplete = metadataComplete;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
*
* @return the components
*/
@@ -113,7 +134,6 @@
*
* @return the extension
*/
- @XmlElement(name = "faces-config-extension", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
public FacesConfigExtension getExtension() {
return extension;
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -72,7 +72,6 @@
*
* @return the type
*/
- @XmlJavaTypeAdapter(ClassAdapter.class)
public ClassDescription getType() {
return type;
}
@@ -91,7 +90,6 @@
*
* @return the defaultValue
*/
- @XmlElement(name = "default-value", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
public String getDefaultValue() {
return defaultValue;
}
@@ -110,7 +108,6 @@
*
* @return the suggestedValue
*/
- @XmlElement(name = "suggested-value", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
public String getSuggestedValue() {
return suggestedValue;
}
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -24,6 +24,8 @@
package org.richfaces.cdk.xmlconfig.model;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
@@ -33,6 +35,8 @@
*
* @author asmirnov(a)exadel.com
*/
+@XmlType(name="faces-config-propertyType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE,
+
propOrder={"key","type","defaultValue","suggestedValue","extension"})
public class PropertyBean extends PropertyBase {
/**
@@ -56,6 +60,7 @@
* @return the type
*/
@XmlElement(name = "property-class", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ @XmlJavaTypeAdapter(ClassAdapter.class)
public ClassDescription getType() {
return super.getType();
}
@@ -67,6 +72,29 @@
}
@Override
+ @XmlElement(name = "default-value", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ public String getDefaultValue() {
+ return super.getDefaultValue();
+ }
+
+ @Override
+ public void setDefaultValue(String defaultValue) {
+ super.setDefaultValue(defaultValue);
+ }
+
+ @Override
+ @XmlElement(name = "suggested-value", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+ public String getSuggestedValue() {
+ return super.getSuggestedValue();
+ }
+
+
+ @Override
+ public void setSuggestedValue(String suggestedValue) {
+ super.setSuggestedValue(suggestedValue);
+ }
+
+ @Override
@XmlElement(name = "property-extension", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
public PropertyExtension getExtension() {
return super.getExtension();
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RenderKitBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -27,6 +27,7 @@
import javax.faces.render.RenderKitFactory;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.richfaces.cdk.model.BehaviorRenderer;
@@ -44,6 +45,8 @@
*
* @author asmirnov(a)exadel.com
*/
+@XmlType(name="faces-config-render-kitType",namespace=ComponentLibrary.FACES_CONFIG_NAMESPACE,
+
propOrder={"key","renderkitClass","renderers","behaviorRenderers","extension"})
public class RenderKitBean extends ExtensibleBean<RenderKitBean.RenderKitExtension>
implements MapEntry<RenderKit.Id> {
private List<Renderer> renderers = Lists.newArrayList();
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/RendererBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -43,7 +43,8 @@
*
* @author asmirnov(a)exadel.com
*/
-@XmlType(name = "faces-config-rendererType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE)
+@XmlType(name = "faces-config-rendererType", namespace =
ComponentLibrary.FACES_CONFIG_NAMESPACE,
+
propOrder={"family","type","rendererClass",/*"facet",*/"attributes","extension"})
public class RendererBean extends
ExtensibleBean<RendererBean.RendererExtension> {
Modified:
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java 2009-12-29
01:12:10 UTC (rev 16216)
+++
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/model/ModelBean.java 2009-12-29
01:12:41 UTC (rev 16217)
@@ -147,6 +147,10 @@
return (R) visitor.visit(this, param);
}
+ @Override
+ public boolean same(ModelBean other) {
+ return null != getType() && getType().equals(other.getType());
+ }
@SuppressWarnings("serial")
public static final class Type extends Key {