Author: alexsmirnov
Date: 2010-01-28 14:40:06 -0500 (Thu, 28 Jan 2010)
New Revision: 16378
Added:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ImportAttributes.java
root/cdk/branches/guice/plugins/generator/src/test/resources/META-INF/cdk/attributes/dummy-template-props.xml
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy-attributes.xml
Modified:
root/cdk/branches/guice/plugins/generator/
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/cdk-template.xsd
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd
root/cdk/branches/guice/plugins/generator/src/main/script/SchemaProcessor.groovy
root/cdk/branches/guice/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml
Log:
merge with 16377 from trunk
Property changes on: root/cdk/branches/guice/plugins/generator
___________________________________________________________________
Name: svn:mergeinfo
-
Modified:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -56,7 +56,6 @@
public static final String LEFT_SQUARE_BRACKET = "[";
public static final String NEGATIVE = "-";
public static final String QUESTION_SIGN = " ? ";
- public static final String QUOTE = "\"";
public static final String RIGHT_BRACKET = ")";
public static final String RIGHT_SQUARE_BRACKET = "]";
public static final String THIS_PREFIX = "this";
Modified:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/StringUtils.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -53,6 +53,7 @@
public static String getEscapedString(String s) {
StringBuilder result = new StringBuilder();
+ result.append('"');
char[] chars = s.toCharArray();
@@ -80,9 +81,29 @@
}
}
+ result.append('"');
+
return result.toString();
}
+ public static String getEscapedStringsArray(String... strings) {
+ StringBuilder sb = new StringBuilder();
+
+ for (String string : strings) {
+ if (sb.length() > 0) {
+ sb.append(", ");
+ }
+
+ sb.append(getEscapedString(string));
+ }
+
+ return sb.toString();
+ }
+
+ public static boolean isEmpty(String s) {
+ return s == null || s.length() == 0;
+ }
+
/**
* Returns true if the char isalpha() or isdigit().
*/
Modified:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstLiteralTreeNode.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -26,7 +26,6 @@
import java.util.Map;
import org.jboss.el.parser.Node;
-import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
import org.richfaces.cdk.parser.el.StringUtils;
@@ -47,9 +46,7 @@
@Override
public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor
visitor) throws ParsingException {
if (getNode().getImage() != null) {
- sb.append(ELNodeConstants.QUOTE);
sb.append(StringUtils.getEscapedString(getNode().getImage()));
- sb.append(ELNodeConstants.QUOTE);
visitor.setVariableType(TypesFactory.getType(String.class));
}
Modified:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstStringTreeNode.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -27,7 +27,6 @@
import org.jboss.el.parser.AstString;
import org.jboss.el.parser.Node;
-import org.richfaces.cdk.parser.el.ELNodeConstants;
import org.richfaces.cdk.parser.el.ELVisitor;
import org.richfaces.cdk.parser.el.ParsingException;
import org.richfaces.cdk.parser.el.StringUtils;
@@ -47,9 +46,7 @@
@Override
public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor
visitor) throws ParsingException {
- sb.append(ELNodeConstants.QUOTE);
sb.append(StringUtils.getEscapedString(((AstString) getNode()).getString()));
- sb.append(ELNodeConstants.QUOTE);
visitor.setVariableType(TypesFactory.getType(String.class));
}
Modified:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -23,6 +23,23 @@
package org.richfaces.cdk.templatecompiler;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+import javax.xml.namespace.QName;
+
import org.richfaces.builder.model.Argument;
import org.richfaces.builder.model.JavaClass;
import org.richfaces.builder.model.JavaField;
@@ -32,6 +49,7 @@
import org.richfaces.builder.model.MethodBodyStatementsContainer;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.Logger;
+import org.richfaces.cdk.LoggerFactory;
import org.richfaces.cdk.attributes.Attribute;
import org.richfaces.cdk.attributes.Element;
import org.richfaces.cdk.attributes.Schema;
@@ -57,23 +75,6 @@
import org.richfaces.cdk.util.Strings;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-import javax.annotation.Generated;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.render.Renderer;
-import javax.inject.Inject;
-import javax.xml.namespace.QName;
-
import com.google.common.collect.Lists;
/**
@@ -144,7 +145,7 @@
this.compositeInterface = compositeInterface;
this.classLoader = classLoader;
- //TODO - cache unmarshalled data
+ // TODO - cache unmarshalled data (as CDKWorker?)
SchemaSet schemaSet =
jaxbBinding.unmarshal("urn:attributes:xhtml-el.xml", null, SchemaSet.class);
this.attributesSchema = schemaSet.getSchemas().get(Template.XHTML_EL_NAMESPACE);
}
@@ -158,9 +159,10 @@
this.generatedClass.addImport(ResponseWriter.class);
this.generatedClass.addImport(UIComponent.class);
- this.generatedClass.addAnnotation(Generated.class, "\"RichFaces
CDK\"");
+ // TODO - make this JavaDoc - Generated annotation is present since JDK6
+ // this.generatedClass.addAnnotation(Generated.class, "\"RichFaces
CDK\"");
// TODO remove this after improving Java model
- this.generatedClass.addImport(Generated.class);
+ // this.generatedClass.addImport(Generated.class);
this.createMethodContext();
}
@@ -260,37 +262,33 @@
return result;
}
- private String createPassThroughAttributeCode(String attributeName, String[]
eventNames) {
+ private String createPassThroughAttributeCode(String htmlAttributeName, Attribute
componentAttribute,
+ String[] eventNames) {
+
generatedClass.addImport("org.richfaces.renderkit.ComponentAttribute");
StringBuilder sb = new StringBuilder();
sb.append("new ComponentAttribute(");
- sb.append('"');
- sb.append(StringUtils.getEscapedString(attributeName));
- sb.append('"');
+ sb.append(StringUtils.getEscapedString(htmlAttributeName));
- boolean isFirstEventName = true;
+ sb.append(")");
+
+ String componentAttributeName = componentAttribute.getComponentAttributeName();
+ if (!StringUtils.isEmpty(componentAttributeName)) {
+ sb.append(".setComponentAttributeName(");
+ sb.append(StringUtils.getEscapedString(componentAttributeName));
+ sb.append(")");
+ }
+
if (eventNames != null && eventNames.length != 0) {
- sb.append(", ");
+ sb.append(".setEventNames(");
sb.append("new String[] {");
- for (String eventName : eventNames) {
- if (isFirstEventName) {
- isFirstEventName = false;
- } else {
- sb.append(", ");
- }
+ sb.append(StringUtils.getEscapedStringsArray(eventNames));
- sb.append('"');
- sb.append(StringUtils.getEscapedString(eventName));
- sb.append('"');
- }
-
- sb.append("}");
+ sb.append("})");
}
-
- sb.append(")");
return sb.toString();
}
@@ -310,12 +308,13 @@
generatedClass.addImport("org.richfaces.renderkit.ComponentAttribute");
generatedClass.addImport("org.richfaces.renderkit.RenderKitUtils");
-
- //TODO - get rid of FQNs for classes via imports
+ generatedClass.addImport(Collections.class);
+
+ // TODO - get rid of FQNs for classes via imports
passThroughField.setGenericArguments(new JavaClass[] { new
JavaClass(String.class),
new JavaClass("org.richfaces.renderkit.ComponentAttribute") });
- StringBuilder fieldValue = new
StringBuilder("ComponentAttribute.createMap(");
+ StringBuilder fieldValue = new
StringBuilder("Collections.unmodifiableMap(ComponentAttribute.createMap(");
boolean isFirstArgument = true;
for (Map.Entry<String, Attribute> entry : attributesMap.entrySet()) {
if (isFirstArgument) {
@@ -325,13 +324,13 @@
}
// TODO behaviors data
- fieldValue.append(createPassThroughAttributeCode(entry.getKey(), null));
+ fieldValue.append(createPassThroughAttributeCode(entry.getKey(),
entry.getValue(), null));
}
- fieldValue.append(")");
-
+ fieldValue.append("))");
+
passThroughField.setValue(fieldValue.toString());
-
+
return passThroughField;
}
@@ -470,7 +469,7 @@
} else {
String attributeLocalName = attributeName.getLocalPart();
if (writtenAttributes.add(attributeLocalName)) {
- //TODO externalize
+ // TODO externalize
generatedClass.addImport("org.richfaces.renderkit.RenderKitUtils");
currentStatement.addStatement(new
WriteAttributeStatement(attributeLocalName, compileEl(
attributeValue.toString(), String.class)));
@@ -498,7 +497,7 @@
if (!actualAttributesMap.isEmpty()) {
JavaField passThroughField =
createPassThroughField(actualAttributesMap);
generatedClass.addField(passThroughField);
- //TODO externalize
+ // TODO externalize
generatedClass.addImport("org.richfaces.renderkit.RenderKitUtils");
currentStatement.addStatement(new
WriteAttributesSetStatement(passThroughField.getName()));
}
Modified:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -49,6 +49,8 @@
private List<ResourceDependency> resourceDependencies;
+ private List<ImportAttributes> attributesImports;
+
private String renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
private String javaClass;
@@ -230,4 +232,24 @@
public void setRendersChildren(boolean rendersChildren) {
this.rendersChildren = rendersChildren;
}
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @return the attributesImports
+ */
+ @XmlElement(name = "import-attributes", namespace =
Template.CDK_NAMESPACE)
+ public List<ImportAttributes> getAttributesImports() {
+ return attributesImports;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @param attributesImports the attributesImports to set
+ */
+ public void setAttributesImports(List<ImportAttributes> attributesImports) {
+ this.attributesImports = attributesImports;
+ }
+
}
Copied:
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ImportAttributes.java
(from rev 16377,
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ImportAttributes.java)
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ImportAttributes.java
(rev 0)
+++
root/cdk/branches/guice/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ImportAttributes.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.cdk.templatecompiler.model;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class ImportAttributes {
+
+ private String source;
+
+ /**
+ * @return the source
+ */
+ @XmlAttribute(name = "src")
+ public String getSource() {
+ return source;
+ }
+
+ /**
+ * @param source the source to set
+ */
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+}
Modified:
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/cdk-template.xsd
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/cdk-template.xsd 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/cdk-template.xsd 2010-01-28
19:40:06 UTC (rev 16378)
@@ -111,6 +111,12 @@
<xs:element name="component-family" />
<xs:element name="renderer-type" />
<xs:element name="renders-children" type="xs:boolean" />
+
+ <xs:element name="import-attributes">
+ <xs:complexType>
+ <xs:attribute use="required" name="src"
type="xs:anyURI" form="unqualified" />
+ </xs:complexType>
+ </xs:element>
<xs:group name="structural">
<xs:choice>
Modified:
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd 2010-01-28
19:40:06 UTC (rev 16378)
@@ -468,6 +468,14 @@
</xs:documentation>
</xs:annotation>
+ <xs:attribute name="class" type="NMTOKENS">
+ <xs:annotation>
+ <xs:appinfo>
+ <cdk-addinfo:component-attribute-name>styleClass</cdk-addinfo:component-attribute-name>
+ </xs:appinfo>
+ </xs:annotation>
+ </xs:attribute>
+
<xs:attributeGroup name="coreattrs">
<xs:annotation>
<xs:documentation>
@@ -481,7 +489,7 @@
</xs:documentation>
</xs:annotation>
<xs:attribute name="id" type="ID" />
- <xs:attribute name="class" type="NMTOKENS" />
+ <xs:attribute ref="class" />
<xs:attribute name="style" type="StyleSheet" />
<xs:attribute name="title" type="Text" />
</xs:attributeGroup>
@@ -3026,11 +3034,11 @@
<xs:group ref="map.children" />
<xs:attributeGroup ref="i18n"></xs:attributeGroup>
<xs:attributeGroup ref="events"></xs:attributeGroup>
- <xs:attribute use="required" name="id"
type="ID"></xs:attribute>
- <xs:attribute name="class"
type="xs:anySimpleType"></xs:attribute>
- <xs:attribute name="style"
type="StyleSheet"></xs:attribute>
- <xs:attribute name="title" type="Text"></xs:attribute>
- <xs:attribute name="name"
type="xs:anySimpleType"></xs:attribute>
+ <xs:attribute use="required" name="id" type="ID"
/>
+ <xs:attribute ref="class" />
+ <xs:attribute name="style" type="StyleSheet" />
+ <xs:attribute name="title" type="Text" />
+ <xs:attribute name="name" type="xs:anySimpleType" />
<xs:attributeGroup ref="cdk:core.attrs" />
</xs:complexType>
Modified:
root/cdk/branches/guice/plugins/generator/src/main/script/SchemaProcessor.groovy
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/main/script/SchemaProcessor.groovy 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/main/script/SchemaProcessor.groovy 2010-01-28
19:40:06 UTC (rev 16378)
@@ -64,7 +64,7 @@
return xPath;
}
- private String getDefaultValue(XSAttributeUse attributeUse) throws
XPathExpressionException {
+ private String getAdditionalInfo(XSAttributeUse attributeUse, String elementName)
throws XPathExpressionException {
String defaultValue = null;
XSAttributeDecl attributeDecl = attributeUse.getDecl();
@@ -73,7 +73,7 @@
Object annotationElement = annotation.getAnnotation();
if (annotationElement != null) {
XPath xPath = createXPath();
- Node node = (Node)
xPath.evaluate("xs:appinfo/cdk-schema-info:default-value", annotationElement,
+ Node node = (Node) xPath.evaluate("xs:appinfo/cdk-schema-info:"
+ elementName, annotationElement,
XPathConstants.NODE);
if (node != null) {
defaultValue = xPath.evaluate("text()", node);
@@ -84,6 +84,14 @@
return defaultValue;
}
+ private String getComponentAttributeName(XSAttributeUse attributeUse) throws
XPathExpressionException {
+ return getAdditionalInfo(attributeUse, "component-attribute-name");
+ }
+
+ private String getDefaultValue(XSAttributeUse attributeUse) throws
XPathExpressionException {
+ return getAdditionalInfo(attributeUse, "default-value");
+ }
+
private boolean isGenericKind(Attribute.Kind attributeKind) {
return Kind.GENERIC.equals(attributeKind);
}
@@ -173,6 +181,7 @@
modelAttribute.setKind(getAttributeKind(attributeDecl.getType()));
modelAttribute.setRequired(xsAttributeUse.isRequired());
modelAttribute.setDefaultValue(getDefaultValue(xsAttributeUse));
+ modelAttribute.setComponentAttributeName(getComponentAttributeName(xsAttributeUse));
}
}
}
Modified:
root/cdk/branches/guice/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-01-28
19:40:06 UTC (rev 16378)
@@ -234,6 +234,15 @@
assertEquals("Required Attribute",
requiredAttribute.getDisplayname());
}
+ private void checkDummyComponentImportedAttribute(Property importedAttribute,
Class<?> type) {
+ assertNotNull(importedAttribute);
+ assertNoEventNames(importedAttribute);
+ assertNoSignature(importedAttribute);
+ assertNoDefaultValue(importedAttribute);
+ assertFalse(importedAttribute.isRequired());
+
+ assertEquals(type.getName(), importedAttribute.getType().getName());
+ }
@Before
@@ -290,7 +299,12 @@
checkDummyComponentIntegerAttribute(attributes.get("integerAttribute"));
checkDummyComponentRequiredAttribute(attributes.get("requiredAttribute"));
- assertEquals(7, attributes.size());
+
checkDummyComponentImportedAttribute(attributes.get("anotherImportedStringProperty"),
String.class);
+
checkDummyComponentImportedAttribute(attributes.get("anotherImportedProperty"),
Object.class);
+
checkDummyComponentImportedAttribute(attributes.get("importedBooleanProperty"),
boolean.class);
+
checkDummyComponentImportedAttribute(attributes.get("importedIntegerProperty"),
Integer.class);
+
+ assertEquals(11, attributes.size());
}
}
Copied:
root/cdk/branches/guice/plugins/generator/src/test/resources/META-INF/cdk/attributes/dummy-template-props.xml
(from rev 16377,
root/cdk/trunk/plugins/generator/src/test/resources/META-INF/cdk/attributes/dummy-template-props.xml)
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/test/resources/META-INF/cdk/attributes/dummy-template-props.xml
(rev 0)
+++
root/cdk/branches/guice/plugins/generator/src/test/resources/META-INF/cdk/attributes/dummy-template-props.xml 2010-01-28
19:40:06 UTC (rev 16378)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright ${year}, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of individual
+ contributors. This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version. This software is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<cdk:properties
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:cdk="http://richfaces.org/cdk/extensions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://java.sun.com/xml/ns/javaee">
+
+ <property>
+ <property-name>importedBooleanProperty</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <property-name>importedIntegerProperty</property-name>
+ <property-class>java.lang.Integer</property-class>
+ </property>
+
+</cdk:properties>
\ No newline at end of file
Copied:
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy-attributes.xml
(from rev 16377,
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy-attributes.xml)
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy-attributes.xml
(rev 0)
+++
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy-attributes.xml 2010-01-28
19:40:06 UTC (rev 16378)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source Copyright ${year}, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the
+ copyright.txt in the distribution for a full listing of individual
+ contributors. This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version. This software is
+ distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU
+ Lesser General Public License along with this software; if not, write
+ to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<cdk:properties
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:cdk="http://richfaces.org/cdk/extensions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://java.sun.com/xml/ns/javaee">
+
+ <property>
+ <property-name>anotherImportedStringProperty</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <property-name>anotherImportedProperty</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+
+</cdk:properties>
\ No newline at end of file
Modified:
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml
===================================================================
---
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml 2010-01-28
19:07:27 UTC (rev 16377)
+++
root/cdk/branches/guice/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml 2010-01-28
19:40:06 UTC (rev 16378)
@@ -28,6 +28,9 @@
<cc:attribute name="integerAttribute" type="java.lang.Integer"
default="-1" />
<cc:attribute name="requiredAttribute" shortDescription="That's a
required attribute"
displayName="Required Attribute" required="true" />
+
+ <cdk:import-attributes
src="urn:resource:org/richfaces/cdk/templatecompiler/dummy-attributes.xml"
/>
+ <cdk:import-attributes src="urn:attributes:dummy-template-props.xml"
/>
</cc:interface>
<cc:implementation />