Author: alexsmirnov
Date: 2009-09-17 22:04:18 -0400 (Thu, 17 Sep 2009)
New Revision: 15619
Added:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/properties.xml
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
Log:
remove unnecessary fragment unmarshaller method.
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-09-18
01:05:13 UTC (rev 15618)
+++
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2009-09-18
02:04:18 UTC (rev 15619)
@@ -155,33 +155,6 @@
}
}
- /**
- * This method parses XML fragment and bind information into designated class instance.
- * @param <T>
- * @param url
- * @param schemaLocation
- * @param bindClass
- * @return
- * @throws CdkException
- */
- public <T> T unmarshalFragment(String url, String schemaLocation, Class<T>
bindClass) throws CdkException{
- try {
- InputSource inputSource = resolver.resolveSystemId(url);
- if (null == inputSource) {
- inputSource = new InputSource(url);
- }
-// DocumentBuilderFactory documentBuilderFactory =
DocumentBuilderFactory.newInstance();
-// DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-// documentBuilder.
- T unmarshal = unmarshal(schemaLocation, bindClass, inputSource);
- return unmarshal;
- } catch (FileNotFoundException e) {
- throw new CdkException("XML file not found", e);
- }
-
- }
-
-
@SuppressWarnings("unchecked")
public <T> T unmarshal(String schemaLocation, Class<T> bindClass,
InputSource inputSource) throws CdkException {
@@ -189,6 +162,8 @@
Source source = createXmlSource(inputSource, schemaLocation);
try {
// Setup JAXB to unmarshal
+ // TODO - create xinclude content handler that process xinclude directives
+ // and send SAX event to the unmarshaller handler.
JAXBContext jc = JAXBContext.newInstance(bindClass);
Unmarshaller u = jc.createUnmarshaller();
ValidationEventCollector vec = new ValidationEventCollector();
Added:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/properties.xml
===================================================================
---
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/properties.xml
(rev 0)
+++
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/properties.xml 2009-09-18
02:04:18 UTC (rev 15619)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cdk:properties
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:cdk="http://richfaces.org/cdk/extensions">
+ <property>
+ <description><![CDATA[test2 property]]></description>
+ <display-name>test2 event property</display-name>
+ <icon>ontest2.png</icon>
+ <property-name>ontest2</property-name>
+ <property-class>int</property-class>
+ <default-value>3</default-value>
+ <suggested-value>15</suggested-value>
+ <property-extension>
+ <cdk:literal>true</cdk:literal>
+ <cdk:generate>true</cdk:generate>
+ <cdk:hidden>true</cdk:hidden>
+ <cdk:required>true</cdk:required>
+ <cdk:pass-through>true</cdk:pass-through>
+ <cdk:event-name>ontest2</cdk:event-name>
+ <cdk:event-name default="true">action</cdk:event-name>
+ <cdk:signature>
+ <cdk:param>boolean</cdk:param>
+ <cdk:param>java.lang.String</cdk:param>
+ </cdk:signature>
+ <cdk:alias>foo</cdk:alias>
+ <cdk:alias>bar</cdk:alias>
+ </property-extension>
+ </property>
+</cdk:properties>
Property changes on:
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/xmlconfig/properties.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native