You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 18:05:37 UTC
[myfaces-trinidad-maven] branch 1.2.10.1-branch created (now
1294715)
This is an automated email from the ASF dual-hosted git repository.
deki pushed a change to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git.
at 1294715 Oops. restoring the branches. It was not supposed to be deleted.
This branch includes the following new commits:
new 3c083e9 branching to 1.2.10.1-branch
new b39564e update pom.xml version to <version>1.2.10.1-SNAPSHOT</version>
new 0285119 update the rest of the poms as well to 1.2.10.1
new 7ceef5a TRINIDAD-1414 - Implement support for specifying List<String> attribute type as String
new 6c2db84 TRINIDAD-1438 - M2 Plugins: Need a way to define a new converter or validator tag with the existing Id
new 662630c TRINIDAD-1441 - Facelets: Need Custom Validator and Converter handlers
new 24745d5 TRINIDAD-1461 - Build framework for jsr-276 metadata
new 780369f TRINIDAD-1466 - Support xinclude'd property metadata
new ca551ad TRINIDAD-1476 - Unnecessary tr and trh namespace declarations in faces-config.xml
new 993cf33 TRINIDAD-1484 - Change Trinidad metadata (build .xml files) to use jsr-276 metadata standard
new cd6a304 TRINIDAD-1494 Support java.util.Set as property type 1.2.10.1-branch of plugins. For Jing Wu
new 5a0991b TRINIDAD-1499 - Regression issues with jsp tag class generation from move to jsr276 metadata
new 98d291f Fix windows new-line endings
new 7f1f415 TRINIDAD-1529 applied patch
new 49d61e5 TRINIDAD-1656 - Maven-faces-plugin faces-config.xml generation does not allow ViewRoot replacement
new f4abe2c removed wrongly applied patch (TRINIDAD-1656) from this branch...
new 1294715 Oops. restoring the branches. It was not supposed to be deleted.
The 17 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <co...@myfaces.apache.org>'].
[myfaces-trinidad-maven] 16/17: removed wrongly applied patch
(TRINIDAD-1656) from this branch...
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit f4abe2c221c4e93c42f52e7ca9b6592328fb0c54
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Wed Dec 16 16:36:04 2009 +0000
removed wrongly applied patch (TRINIDAD-1656) from this branch...
---
.../plugin/faces/resources/transform12.xsl | 2143 ++++++++++----------
1 file changed, 1071 insertions(+), 1072 deletions(-)
diff --git a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
index 8b0f500..a795e9e 100644
--- a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
+++ b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
@@ -1,1072 +1,1071 @@
-<?xml version="1.0" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you 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.
-
--->
-<xsl:stylesheet xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
- xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"
- xmlns:exsl="http://exslt.org/common"
- exclude-result-prefixes="xsl xs javaee mfp fmd"
- version="1.0">
-
- <xsl:output method="xml" indent="yes"/>
- <xsl:param name="packageContains" />
- <xsl:param name="converterPackageContains" />
- <xsl:param name="validatorPackageContains" />
- <xsl:param name="typePrefix" />
- <xsl:param name="removeRenderers" />
-
-
-
- <xsl:key name="component-type"
- match="javaee:component"
- use="javaee:component-type/text()" />
-
- <xsl:key name="render-kit-id"
- match="javaee:render-kit"
- use="javaee:render-kit-id/text()" />
-
- <!-- switch off default text processing -->
- <xsl:template match="//text()" />
-
- <!-- these are used for inserting a namespace declaration in xslt 1.0 -->
- <xsl:variable name="tr">
- <xsl:element name="tr:xxx" namespace="http://myfaces.apache.org/trinidad"/>
- </xsl:variable>
- <xsl:variable name="trh">
- <xsl:element name="trh:xxx" namespace="http://myfaces.apache.org/trinidad/html"/>
- </xsl:variable>
- <xsl:variable name="fmd">
- <xsl:element name="fmd:xxx" namespace="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"/>
- </xsl:variable>
- <xsl:variable name="mfp">
- <xsl:element name="mfp:xxx" namespace="http://myfaces.apache.org/maven-faces-plugin"/>
- </xsl:variable>
- <xsl:variable name="mafp">
- <xsl:element name="mafp:xxx" namespace="http://xmlns.oracle.com/maven-adf-faces-plugin"/>
- </xsl:variable>
-
- <xsl:template match="/javaee:faces-config" >
- <xsl:element name="faces-config"
- namespace="http://java.sun.com/xml/ns/javaee" >
- <!-- Add namespace declarations at root element, so they don't show up at lower elements when we change namespaces -->
- <xsl:copy-of select="exsl:node-set($tr)//namespace::*"/>
- <xsl:copy-of select="exsl:node-set($trh)//namespace::*"/>
- <xsl:copy-of select="exsl:node-set($fmd)//namespace::*"/>
- <xsl:copy-of select="exsl:node-set($mfp)//namespace::*"/>
- <xsl:copy-of select="exsl:node-set($mafp)//namespace::*"/>
- <xsl:attribute name="xsi:schemaLocation">http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd</xsl:attribute>
- <xsl:attribute name="version">1.2</xsl:attribute>
- <xsl:apply-templates select="javaee:application" />
- <xsl:apply-templates select="javaee:factory" />
- <xsl:apply-templates select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(), 'abstract')) and
- (starts-with(javaee:component-type, $typePrefix) or
- (contains(javaee:component-type, 'javax.faces.ViewRoot')))]" />
- <xsl:apply-templates select="javaee:converter[contains(javaee:converter-class, $converterPackageContains)]" />
- <xsl:apply-templates select="javaee:managed-bean[contains(javaee:managed-bean-class, $packageContains)]" />
- <xsl:apply-templates select="javaee:navigation-rule" />
- <xsl:apply-templates select="javaee:referenced-bean" />
- <!-- merge the render-kits together -->
- <xsl:for-each select="javaee:render-kit[contains(javaee:render-kit-class, $packageContains)]" >
- <xsl:element name="render-kit" >
- <xsl:apply-templates select="javaee:description" />
- <xsl:apply-templates select="javaee:display-name" />
- <xsl:apply-templates select="javaee:icon" />
- <xsl:apply-templates select="javaee:render-kit-id" />
- <xsl:apply-templates select="javaee:render-kit-class" />
- <!-- Drop renderers if desired -->
- <xsl:if test="$removeRenderers != 'true'">
- <xsl:for-each select="key('render-kit-id', javaee:render-kit-id/text())" >
- <xsl:apply-templates select="javaee:renderer[contains(javaee:renderer-class, $packageContains)]" />
- </xsl:for-each>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="javaee:lifecycle[contains(javaee:phase-listener, $packageContains)]" />
- <xsl:apply-templates select="javaee:validator[contains(javaee:validator-class, $validatorPackageContains)]" />
- <xsl:apply-templates select="javaee:faces-config-extension" />
- </xsl:element>
- </xsl:template>
-
- <!-- this templates applies javaee:property templates
- for a component and all supertypes -->
- <xsl:template name="apply-property-templates" >
- <xsl:param name="component" />
- <xsl:param name="skip"></xsl:param>
- <xsl:variable name="componentSupertype"
- select="$component/javaee:component-extension/mfp:component-supertype/text()" />
- <xsl:if test="$componentSupertype" >
- <xsl:call-template name="apply-property-templates" >
- <xsl:with-param name="component"
- select="key('component-type', $componentSupertype)" />
- <!-- "Recursively" build a skip set of nodes. This is created as a
- string and appended to for every super class applied. The square
- brackets are used for a "whole-world" type of functionality. -->
- <xsl:with-param name="skip"><xsl:value-of select="$skip"
- /><xsl:for-each
- select="$component/javaee:property/javaee:property-name"
- >[<xsl:value-of select="normalize-space(text())" />]</xsl:for-each>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- uncomment this code to help debug the skip functionality: -->
- <!--xsl:comment>
- Skip is: <xsl:value-of select="$skip" />
- </xsl:comment-->
- <xsl:for-each select="$component/javaee:property">
- <xsl:variable name="searchFor">[<xsl:value-of
- select="normalize-space(javaee:property-name/text())"/>]</xsl:variable>
- <!-- Do not include this element if it is overridden in the sub-type -->
- <xsl:if
- test="not(contains($skip, $searchFor))">
- <xsl:apply-templates select="." />
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
- <!-- this templates applies javaee:attribute templates
- for a component and all supertypes -->
- <xsl:template name="apply-attribute-templates" >
- <xsl:param name="component" />
- <xsl:param name="skip"></xsl:param>
- <xsl:variable name="componentSupertype"
- select="$component/javaee:component-extension/mfp:component-supertype/text()" />
- <xsl:if test="$componentSupertype" >
- <xsl:call-template name="apply-attribute-templates" >
- <xsl:with-param name="component"
- select="key('component-type', $componentSupertype)" />
- <!-- "Recursively" build a skip set of nodes. This is created as a
- string and appended to for every super class applied. The square
- brackets are used for a "whole-world" type of functionality. -->
- <xsl:with-param name="skip"><xsl:value-of select="$skip"
- /><xsl:for-each
- select="$component/javaee:attribute/javaee:attribute-name"
- >[<xsl:value-of select="normalize-space(text())" />]</xsl:for-each>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- uncomment this code to help debug the skip functionality: -->
- <!--xsl:comment>
- Skip is: <xsl:value-of select="$skip" />
- </xsl:comment-->
- <xsl:for-each select="$component/javaee:attribute">
- <xsl:variable name="searchFor">[<xsl:value-of
- select="normalize-space(javaee:attribute-name/text())"/>]</xsl:variable>
- <!-- Do not include this element if it is overridden in the sub-type -->
- <xsl:if
- test="not(contains($skip, $searchFor))">
- <xsl:apply-templates select="." />
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
- <!-- this templates applies javaee:facet templates
- for a component and all supertypes -->
- <xsl:template name="apply-facet-templates" >
- <xsl:param name="component" />
- <xsl:param name="skip"></xsl:param>
- <xsl:variable name="componentSupertype"
- select="$component/javaee:component-extension/mfp:component-supertype/text()" />
- <xsl:if test="$componentSupertype" >
- <xsl:call-template name="apply-facet-templates" >
- <xsl:with-param name="component"
- select="key('component-type', $componentSupertype)" />
- <!-- "Recursively" build a skip set of nodes. This is created as a
- string and appended to for every super class applied. The square
- brackets are used for a "whole-world" type of functionality. -->
- <xsl:with-param name="skip"><xsl:value-of select="$skip"
- /><xsl:for-each
- select="$component/javaee:facet/javaee:facet-name"
- >[<xsl:value-of select="normalize-space(text())" />]</xsl:for-each>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- uncomment this code to help debug the skip functionality: -->
- <!--xsl:comment>
- Skip is: <xsl:value-of select="$skip" />
- </xsl:comment-->
- <xsl:for-each select="$component/javaee:facet">
- <xsl:variable name="searchFor">[<xsl:value-of
- select="normalize-space(javaee:facet-name/text())"/>]</xsl:variable>
- <!-- Do not include this element if it is overridden in the sub-type -->
- <xsl:if
- test="not(contains($skip, $searchFor))">
- <xsl:apply-templates select="." />
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template match="//javaee:component[javaee:component-extension/mfp:component-supertype]"
- priority="1" >
- <xsl:element name="component" >
- <xsl:apply-templates select="javaee:description" />
- <xsl:apply-templates select="javaee:display-name" />
- <xsl:apply-templates select="javaee:icon" />
- <xsl:apply-templates select="javaee:component-type" />
- <xsl:apply-templates select="javaee:component-class" />
- <xsl:call-template name="apply-facet-templates" >
- <xsl:with-param name="component" select="." />
- </xsl:call-template>
- <xsl:call-template name="apply-attribute-templates" >
- <xsl:with-param name="component" select="." />
- </xsl:call-template>
- <xsl:call-template name="apply-property-templates" >
- <xsl:with-param name="component" select="." />
- </xsl:call-template>
- <xsl:apply-templates select="javaee:component-extension" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:application" >
- <xsl:element name="application" >
- <xsl:apply-templates select="javaee:action-listener[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:default-render-kit-id" />
- <xsl:apply-templates select="javaee:message-bundle[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:view-handler[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:state-manager[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:navigation-handler[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:el-resolver[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:property-resolver[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:variable-resolver[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:locale-config" />
- <xsl:apply-templates select="javaee:resource-bundle" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:action-listener" >
- <xsl:element name="action-listener" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:default-render-kit-id" >
- <xsl:element name="default-render-kit-id" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:message-bundle" >
- <xsl:element name="message-bundle" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:navigation-handler" >
- <xsl:element name="navigation-handler" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:view-handler" >
- <xsl:element name="view-handler" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:state-manager" >
- <xsl:element name="state-manager" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:el-resolver" >
- <xsl:element name="el-resolver" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:property-resolver" >
- <xsl:element name="property-resolver" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:variable-resolver" >
- <xsl:element name="variable-resolver" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:locale-config" >
- <xsl:element name="locale-config" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:factory" >
- <xsl:element name="factory" >
- <xsl:apply-templates select="javaee:application-factory[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:faces-context-factory[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:lifecycle-factory[contains(text(), $packageContains)]" />
- <xsl:apply-templates select="javaee:render-kit-factory[contains(text(), $packageContains)]" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:application-factory" >
- <xsl:element name="application-factory" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:faces-context-factory" >
- <xsl:element name="faces-context-factory" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:lifecycle-factory" >
- <xsl:element name="lifecycle-factory" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:render-kit-factory" >
- <xsl:element name="render-kit-factory" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component" >
- <xsl:element name="component" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component-type" >
- <xsl:element name="component-type" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component-class" >
- <xsl:element name="component-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component/javaee:facet[1]" priority="1" >
- <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> facets</xsl:comment>
- <xsl:element name="facet" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:facet" >
- <xsl:element name="facet" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:facet-name" >
- <xsl:element name="facet-name" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:facet-extension">
- <!-- Make sure not empty -->
- <xsl:if test="*">
- <xsl:element name="facet-extension">
- <!-- Check for possible children of the metadata -->
- <xsl:if test="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee']">
- <xsl:apply-templates select="fmd:facet-metadata"/>
- <xsl:element name="facet-metadata">
- <!-- Select metadata children -->
- <xsl:apply-templates select="mfp:facet-metadata/*[
- namespace-uri() != 'http://java.sun.com/xml/ns/javaee']" />
- <!-- Add non-metadata children under the metadata -->
- <xsl:apply-templates select="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
- and namespace-uri() != 'http://java.sun.com/xml/ns/javaee/faces/design-time-metadata'
- and (
- namespace-uri() != 'http://myfaces.apache.org/maven-faces-plugin'
- or name() != 'mfp:facet-metadata'
- )]" />
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
-
- <xsl:template match="//javaee:component/javaee:attribute[1]" priority="1" >
- <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> attributes</xsl:comment>
- <xsl:element name="attribute" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component/javaee:attribute[1]" priority="1" >
- <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> attributes</xsl:comment>
- <xsl:element name="attribute" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:attribute" >
- <xsl:element name="attribute" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:attribute-name" >
- <xsl:element name="attribute-name" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:attribute-class" >
- <xsl:element name="attribute-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:attribute-extension" >
- <xsl:element name="attribute-extension" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component/javaee:property[1]" priority="1" >
- <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> properties</xsl:comment>
- <xsl:element name="property" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:property[javaee:property-name/text() = 'binding']" priority='2' >
- <!-- skip over properties named 'binding' -->
- </xsl:template>
-
- <xsl:template match="//javaee:property" >
- <xsl:element name="property" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:property-name" >
- <xsl:element name="property-name" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:property-class" >
- <xsl:element name="property-class" >
- <!-- eliminate generics for 1.4-based classes in JSF 1.1 -->
- <xsl:choose>
- <xsl:when test="contains(text(), '<')" >
- <xsl:value-of select="substring-before(text(), '<')" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="text()" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:property-extension">
- <!-- Make sure not empty -->
- <xsl:if test="*">
- <xsl:element name="property-extension">
- <!-- Check for possible children of the metadata -->
- <xsl:if test="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee']">
- <xsl:apply-templates select="fmd:property-metadata"/>
- <xsl:element name="property-metadata">
- <!-- Select metadata children -->
- <xsl:apply-templates select="mfp:property-metadata/*[
- namespace-uri() != 'http://java.sun.com/xml/ns/javaee']" />
- <!-- Add non-metadata children under the metadata -->
- <xsl:apply-templates select="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
- and namespace-uri() != 'http://java.sun.com/xml/ns/javaee/faces/design-time-metadata'
- and (
- namespace-uri() != 'http://myfaces.apache.org/maven-faces-plugin'
- or name() != 'mfp:property-metadata'
- )]" />
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <!-- this templates grabs the component-family from an ancestor -->
- <xsl:template match="//javaee:component-extension[mfp:component-supertype]" priority="1" >
- <xsl:variable name="componentSupertype"
- select="mfp:component-supertype/text()" />
- <xsl:element name="component-extension" >
- <xsl:element name="component-family">
- <xsl:value-of select="key('component-type', $componentSupertype)/javaee:component-extension/mfp:component-family/text()" />
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component-extension[mfp:component-family]" priority="2" >
- <xsl:element name="component-extension" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component-extension" >
- <xsl:comment>Warning: this component has no component-family!</xsl:comment>
- <xsl:element name="component-extension" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//mfp:component-metadata" >
- <xsl:element name="component-metadata" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:converter" >
- <xsl:element name="converter" >
- <!-- xsl:apply-templates/ TODO use this instead -->
- <xsl:apply-templates select="javaee:description"/>
- <xsl:apply-templates select="javaee:display-name"/>
- <xsl:apply-templates select="javaee:converter-id"/>
- <xsl:apply-templates select="javaee:converter-for-class"/>
- <xsl:apply-templates select="javaee:converter-class"/>
- <xsl:apply-templates select="javaee:property"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:converter-id" >
- <xsl:element name="converter-id" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:converter-for-class" >
- <xsl:element name="converter-for-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:converter-class" >
- <xsl:element name="converter-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:managed-bean" >
- <xsl:element name="managed-bean" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:managed-bean-name" >
- <xsl:element name="managed-bean-name" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:managed-bean-class" >
- <xsl:element name="managed-bean-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:managed-bean-scope" >
- <xsl:element name="managed-bean-scope" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:managed-property" >
- <xsl:element name="managed-property" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:null-value" >
- <xsl:element name="null-value" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:value" >
- <xsl:element name="value" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:map-entries" >
- <xsl:element name="map-entries" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:map-entry" >
- <xsl:element name="map-entry" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:key" >
- <xsl:element name="key" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:key-class" >
- <xsl:element name="key-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:value-class" >
- <xsl:element name="value-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:message-bundle" >
- <xsl:element name="message-bundle" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:list-entries" >
- <xsl:element name="list-entries" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:navigation-rule" >
- <xsl:element name="navigation-rule" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:from-view-id" >
- <xsl:element name="from-view-id" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:navigation-case" >
- <xsl:element name="navigation-case" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:from-action" >
- <xsl:element name="from-action" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:from-outcome" >
- <xsl:element name="from-outcome" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:to-view-id" >
- <xsl:element name="to-view-id" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:redirect" >
- <xsl:element name="redirect" />
- </xsl:template>
-
- <xsl:template match="//javaee:referenced-bean" >
- <xsl:element name="referenced-bean" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:referenced-bean-name" >
- <xsl:element name="referenced-bean-name" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:referenced-bean-class" >
- <xsl:element name="referenced-bean-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:render-kit" >
- <xsl:element name="render-kit" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:render-kit-id" >
- <xsl:element name="render-kit-id" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:render-kit-class" >
- <xsl:element name="render-kit-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
-<!-- TODO: flatten component properties into renderer as attributes -->
-<!--
- <xsl:template match="//javaee:renderer[javaee:renderer-extension/mfp:component-type]"
- priority="1" >
- <xsl:element name="renderer" >
- <xsl:apply-templates select="javaee:component-family" />
- <xsl:apply-templates select="javaee:renderer-type" />
- <xsl:apply-templates select="javaee:renderer-class" />
- <xsl:variable name="componentType" select="javaee:renderer-extension/mfp:component-type/text()" />
- <xsl:for-each select="key('component-type', $componentType)/javaee:property" >
- <xsl:element name="attribute" >
- <xsl:apply-templates select="javaee:description" />
- <xsl:apply-templates select="javaee:display-name" />
- <xsl:apply-templates select="javaee:icon" />
- <xsl:element name="attribute-name" >
- <xsl:value-of select="javaee:property-name" />
- </xsl:element>
- <xsl:element name="attribute-class" >
- <xsl:value-of select="javaee:property-class" />
- </xsl:element>
- <xsl:apply-templates select="javaee:default-value" />
- <xsl:apply-templates select="javaee:suggested-value" />
- <xsl:element name="attribute-extension" >
- <xsl:apply-templates select="mfp:property-extension/*" />
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="javaee:attribute" />
- <xsl:apply-templates select="javaee:renderer-extension" />
- </xsl:element>
- </xsl:template>
--->
-
- <xsl:template match="//javaee:renderer" >
- <xsl:element name="renderer" >
- <xsl:apply-templates />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:component-family" >
- <xsl:element name="component-family" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:renderer-type" >
- <xsl:element name="renderer-type" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:renderer-class" >
- <xsl:element name="renderer-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:renderer-extension[mfp:unsupported-agents]" >
- <xsl:element name="renderer-extension" >
- <xsl:element name="renderer-metadata" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:lifecycle" >
- <xsl:element name="lifecycle" >
- <xsl:apply-templates select="javaee:phase-listener[contains(text(), $packageContains)]" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:phase-listener" >
- <xsl:element name="phase-listener" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:default-locale" >
- <xsl:element name="default-locale" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:supported-locale" >
- <xsl:element name="supported-locale" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:validator" >
- <xsl:element name="validator" >
- <!-- xsl:apply-templates/ TODO use this instead -->
- <xsl:apply-templates select="javaee:display-name"/>
- <xsl:apply-templates select="javaee:validator-id"/>
- <xsl:apply-templates select="javaee:validator-class"/>
- <xsl:apply-templates select="javaee:property"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:validator-id" >
- <xsl:element name="validator-id" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:validator-class" >
- <xsl:element name="validator-class" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:description" >
- <xsl:element name="description" >
- <xsl:apply-templates select="@*" />
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template
- match="//javaee:property[javaee:property-extension/mfp:long-description]/javaee:description"
- priority="1">
- <xsl:element name="description" >
- <xsl:apply-templates select="../javaee:property-extension/mfp:long-description/@*" />
- <xsl:value-of select="../javaee:property-extension/mfp:long-description/text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:description/@xml:lang" >
- <xsl:attribute name="xml:lang" ><xsl:value-of select="@xml:lang" /></xsl:attribute>
- </xsl:template>
-
- <xsl:template match="//javaee:display-name" >
- <xsl:element name="display-name" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:icon" >
- <xsl:element name="icon" >
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:small-icon" >
- <xsl:element name="small-icon" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:large-icon" >
- <xsl:element name="large-icon" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:default-value" >
- <xsl:element name="default-value" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:suggested-value" >
- <xsl:element name="suggested-value" >
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//mfp:property-values">
- <!-- Rename this element -->
- <xsl:element name="attribute-values">
- <xsl:value-of select="text()" />
- </xsl:element>
- </xsl:template>
-
- <!-- Handle metadata we do not know about by letting it through. Currently,
- just for property-extension and component-metadata, but should be global.
- See JIRA issues ADFFACES-358, ADFFACES-361 and ADFFACES-472 -->
- <xsl:template match="javaee:property-extension/*[
- namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
- and namespace-uri() !='http://myfaces.apache.org/maven-faces-plugin'
- and namespace-uri() !='http://java.sun.com/xml/ns/javaee/faces/design-time-metadata']">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- <xsl:value-of select="text()"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="mfp:component-metadata/*[
- namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
- and namespace-uri() !='http://myfaces.apache.org/maven-faces-plugin']">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- <xsl:value-of select="text()"/>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="//*[
- namespace-uri() = 'http://myfaces.apache.org/maven-faces-plugin']"
- priority="-1">
- <xsl:element name="{local-name()}" >
- <xsl:apply-templates select="@*|node()"/>
- <xsl:value-of select="text()"/>
- </xsl:element>
- </xsl:template>
-
- <!-- Rule for the jsr-276 (top level) component metadata, just copy the whole thing -->
- <xsl:template match="//fmd:component-metadata">
- <xsl:element name="fmd:component-metadata">
- <xsl:copy-of select="*"/>
- </xsl:element>
- </xsl:template>
-
- <!-- Rule for the jsr-276 (top level) property metadata, just copy the whole thing -->
- <xsl:template match="//fmd:property-metadata">
- <xsl:element name="fmd:property-metadata">
- <xsl:copy-of select="*"/>
- </xsl:element>
- </xsl:template>
-
- <!-- Rule for the jsr-276 (top level) facet metadata, just copy the whole thing -->
- <xsl:template match="//fmd:facet-metadata">
- <xsl:element name="fmd:facet-metadata">
- <xsl:copy-of select="*"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//javaee:faces-config-extension">
- <xsl:apply-templates select="fmd:global-metadata"/>
- </xsl:template>
-
- <!-- Rule for the jsr-276 (top level) global metadata extension -->
- <xsl:template match="//fmd:global-metadata">
- <xsl:element name="faces-config-extension">
- <xsl:element name="fmd:global-metadata">
- <xsl:apply-templates select="fmd:contract-definitions"/>
- <xsl:apply-templates select="fmd:component-category-definitions"/>
- <xsl:apply-templates select="fmd:property-category-definitions"/>
- <xsl:apply-templates select="fmd:faces-taglib-definitions"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//fmd:contract-definitions">
- <xsl:element name="fmd:contract-definitions">
- <xsl:copy-of select="*"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//fmd:component-category-definitions">
- <xsl:element name="fmd:component-category-definitions">
- <xsl:copy-of select="*"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//fmd:property-category-definitions">
- <xsl:element name="fmd:property-category-definitions">
- <xsl:copy-of select="*"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//fmd:faces-taglib-definitions">
- <xsl:element name="fmd:faces-taglib-definitions">
- <xsl:apply-templates select="fmd:faces-taglib"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="//fmd:faces-taglib">
- <xsl:element name="fmd:faces-taglib">
- <xsl:copy-of select="*"/>
- <xsl:variable name="tagPrefix" select="fmd:short-name/text()"/>
- <xsl:apply-templates select="*"/>
- <xsl:for-each select="//javaee:validator">
- <xsl:if test="starts-with(javaee:validator-extension/mfp:tag-name/text(), $tagPrefix)" >
- <xsl:element name="fmd:tag">
- <xsl:element name="fmd:name">
- <xsl:value-of select="substring-after(javaee:validator-extension/mfp:tag-name/text(), ':')"/>
- </xsl:element>
- <xsl:element name="fmd:validator-id">
- <xsl:value-of select="javaee:validator-id/text()"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="//javaee:converter" >
- <xsl:if test="starts-with(javaee:converter-extension/mfp:tag-name/text(), $tagPrefix)" >
- <xsl:element name="fmd:tag">
- <xsl:element name="fmd:name">
- <xsl:value-of select="substring-after(javaee:converter-extension/mfp:tag-name/text(), ':')"/>
- </xsl:element>
- <xsl:element name="fmd:converter-id">
- <xsl:value-of select="javaee:converter-id/text()"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="//javaee:component" >
- <xsl:if test="starts-with(javaee:component-extension/mfp:tag-name/text(), $tagPrefix)" >
- <xsl:element name="fmd:tag">
- <xsl:element name="fmd:name">
- <xsl:value-of select="substring-after(javaee:component-extension/mfp:tag-name/text(), ':')"/>
- </xsl:element>
- <xsl:element name="fmd:component-type">
- <xsl:value-of select="javaee:component-type/text()"/>
- </xsl:element>
- <xsl:element name="fmd:renderer-type">
- <xsl:value-of select="javaee:component-extension/mfp:renderer-type/text()"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
-
- <!-- Blacklisted mfp: that should not be copied over into the faces-config.xml: -->
- <xsl:template match="//mfp:alternate-class" />
- <xsl:template match="//mfp:author" />
- <xsl:template match="//mfp:component-metadata/mfp:group" />
- <xsl:template match="//mfp:component-superclass" />
- <xsl:template match="//mfp:component-supertype" />
- <xsl:template match="//mfp:event" />
- <xsl:template match="//mfp:example" />
- <xsl:template match="//mfp:implementation-type" />
- <xsl:template match="//mfp:java-constructor" />
- <xsl:template match="//mfp:javadoc-tags" />
- <xsl:template match="//mfp:javascript-class" />
- <xsl:template match="//mfp:jsp-property-name" />
- <xsl:template match="//mfp:long-description" />
- <xsl:template match="//mfp:method-binding-signature" />
- <xsl:template match="//mfp:screenshot" />
- <xsl:template match="//mfp:short-description" />
- <xsl:template match="//mfp:state-holder" />
- <xsl:template match="//mfp:tag-attribute-excluded" />
- <xsl:template match="//mfp:tag-class" />
- <xsl:template match="//mfp:tag-class-modifier" />
- <xsl:template match="//mfp:tag-name" />
- <xsl:template match="//mfp:uix2-local-name" />
- <xsl:template match="//mfp:unsupported-render-kit" />
- <xsl:template match="//mfp:unsupported-render-kits" />
- <xsl:template match="//mfp:use-max-time" />
- <xsl:template match="//mfp:warn-if-not-specified" />
-
-</xsl:stylesheet>
+<?xml version="1.0" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+
+-->
+<xsl:stylesheet xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
+ xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"
+ xmlns:exsl="http://exslt.org/common"
+ exclude-result-prefixes="xsl xs javaee mfp fmd"
+ version="1.0">
+
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:param name="packageContains" />
+ <xsl:param name="converterPackageContains" />
+ <xsl:param name="validatorPackageContains" />
+ <xsl:param name="typePrefix" />
+ <xsl:param name="removeRenderers" />
+
+
+
+ <xsl:key name="component-type"
+ match="javaee:component"
+ use="javaee:component-type/text()" />
+
+ <xsl:key name="render-kit-id"
+ match="javaee:render-kit"
+ use="javaee:render-kit-id/text()" />
+
+ <!-- switch off default text processing -->
+ <xsl:template match="//text()" />
+
+ <!-- these are used for inserting a namespace declaration in xslt 1.0 -->
+ <xsl:variable name="tr">
+ <xsl:element name="tr:xxx" namespace="http://myfaces.apache.org/trinidad"/>
+ </xsl:variable>
+ <xsl:variable name="trh">
+ <xsl:element name="trh:xxx" namespace="http://myfaces.apache.org/trinidad/html"/>
+ </xsl:variable>
+ <xsl:variable name="fmd">
+ <xsl:element name="fmd:xxx" namespace="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"/>
+ </xsl:variable>
+ <xsl:variable name="mfp">
+ <xsl:element name="mfp:xxx" namespace="http://myfaces.apache.org/maven-faces-plugin"/>
+ </xsl:variable>
+ <xsl:variable name="mafp">
+ <xsl:element name="mafp:xxx" namespace="http://xmlns.oracle.com/maven-adf-faces-plugin"/>
+ </xsl:variable>
+
+ <xsl:template match="/javaee:faces-config" >
+ <xsl:element name="faces-config"
+ namespace="http://java.sun.com/xml/ns/javaee" >
+ <!-- Add namespace declarations at root element, so they don't show up at lower elements when we change namespaces -->
+ <xsl:copy-of select="exsl:node-set($tr)//namespace::*"/>
+ <xsl:copy-of select="exsl:node-set($trh)//namespace::*"/>
+ <xsl:copy-of select="exsl:node-set($fmd)//namespace::*"/>
+ <xsl:copy-of select="exsl:node-set($mfp)//namespace::*"/>
+ <xsl:copy-of select="exsl:node-set($mafp)//namespace::*"/>
+ <xsl:attribute name="xsi:schemaLocation">http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd</xsl:attribute>
+ <xsl:attribute name="version">1.2</xsl:attribute>
+ <xsl:apply-templates select="javaee:application" />
+ <xsl:apply-templates select="javaee:factory" />
+ <xsl:apply-templates select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(), 'abstract')) and
+ starts-with(javaee:component-type, $typePrefix)]" />
+ <xsl:apply-templates select="javaee:converter[contains(javaee:converter-class, $converterPackageContains)]" />
+ <xsl:apply-templates select="javaee:managed-bean[contains(javaee:managed-bean-class, $packageContains)]" />
+ <xsl:apply-templates select="javaee:navigation-rule" />
+ <xsl:apply-templates select="javaee:referenced-bean" />
+ <!-- merge the render-kits together -->
+ <xsl:for-each select="javaee:render-kit[contains(javaee:render-kit-class, $packageContains)]" >
+ <xsl:element name="render-kit" >
+ <xsl:apply-templates select="javaee:description" />
+ <xsl:apply-templates select="javaee:display-name" />
+ <xsl:apply-templates select="javaee:icon" />
+ <xsl:apply-templates select="javaee:render-kit-id" />
+ <xsl:apply-templates select="javaee:render-kit-class" />
+ <!-- Drop renderers if desired -->
+ <xsl:if test="$removeRenderers != 'true'">
+ <xsl:for-each select="key('render-kit-id', javaee:render-kit-id/text())" >
+ <xsl:apply-templates select="javaee:renderer[contains(javaee:renderer-class, $packageContains)]" />
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="javaee:lifecycle[contains(javaee:phase-listener, $packageContains)]" />
+ <xsl:apply-templates select="javaee:validator[contains(javaee:validator-class, $validatorPackageContains)]" />
+ <xsl:apply-templates select="javaee:faces-config-extension" />
+ </xsl:element>
+ </xsl:template>
+
+ <!-- this templates applies javaee:property templates
+ for a component and all supertypes -->
+ <xsl:template name="apply-property-templates" >
+ <xsl:param name="component" />
+ <xsl:param name="skip"></xsl:param>
+ <xsl:variable name="componentSupertype"
+ select="$component/javaee:component-extension/mfp:component-supertype/text()" />
+ <xsl:if test="$componentSupertype" >
+ <xsl:call-template name="apply-property-templates" >
+ <xsl:with-param name="component"
+ select="key('component-type', $componentSupertype)" />
+ <!-- "Recursively" build a skip set of nodes. This is created as a
+ string and appended to for every super class applied. The square
+ brackets are used for a "whole-world" type of functionality. -->
+ <xsl:with-param name="skip"><xsl:value-of select="$skip"
+ /><xsl:for-each
+ select="$component/javaee:property/javaee:property-name"
+ >[<xsl:value-of select="normalize-space(text())" />]</xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- uncomment this code to help debug the skip functionality: -->
+ <!--xsl:comment>
+ Skip is: <xsl:value-of select="$skip" />
+ </xsl:comment-->
+ <xsl:for-each select="$component/javaee:property">
+ <xsl:variable name="searchFor">[<xsl:value-of
+ select="normalize-space(javaee:property-name/text())"/>]</xsl:variable>
+ <!-- Do not include this element if it is overridden in the sub-type -->
+ <xsl:if
+ test="not(contains($skip, $searchFor))">
+ <xsl:apply-templates select="." />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- this templates applies javaee:attribute templates
+ for a component and all supertypes -->
+ <xsl:template name="apply-attribute-templates" >
+ <xsl:param name="component" />
+ <xsl:param name="skip"></xsl:param>
+ <xsl:variable name="componentSupertype"
+ select="$component/javaee:component-extension/mfp:component-supertype/text()" />
+ <xsl:if test="$componentSupertype" >
+ <xsl:call-template name="apply-attribute-templates" >
+ <xsl:with-param name="component"
+ select="key('component-type', $componentSupertype)" />
+ <!-- "Recursively" build a skip set of nodes. This is created as a
+ string and appended to for every super class applied. The square
+ brackets are used for a "whole-world" type of functionality. -->
+ <xsl:with-param name="skip"><xsl:value-of select="$skip"
+ /><xsl:for-each
+ select="$component/javaee:attribute/javaee:attribute-name"
+ >[<xsl:value-of select="normalize-space(text())" />]</xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- uncomment this code to help debug the skip functionality: -->
+ <!--xsl:comment>
+ Skip is: <xsl:value-of select="$skip" />
+ </xsl:comment-->
+ <xsl:for-each select="$component/javaee:attribute">
+ <xsl:variable name="searchFor">[<xsl:value-of
+ select="normalize-space(javaee:attribute-name/text())"/>]</xsl:variable>
+ <!-- Do not include this element if it is overridden in the sub-type -->
+ <xsl:if
+ test="not(contains($skip, $searchFor))">
+ <xsl:apply-templates select="." />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- this templates applies javaee:facet templates
+ for a component and all supertypes -->
+ <xsl:template name="apply-facet-templates" >
+ <xsl:param name="component" />
+ <xsl:param name="skip"></xsl:param>
+ <xsl:variable name="componentSupertype"
+ select="$component/javaee:component-extension/mfp:component-supertype/text()" />
+ <xsl:if test="$componentSupertype" >
+ <xsl:call-template name="apply-facet-templates" >
+ <xsl:with-param name="component"
+ select="key('component-type', $componentSupertype)" />
+ <!-- "Recursively" build a skip set of nodes. This is created as a
+ string and appended to for every super class applied. The square
+ brackets are used for a "whole-world" type of functionality. -->
+ <xsl:with-param name="skip"><xsl:value-of select="$skip"
+ /><xsl:for-each
+ select="$component/javaee:facet/javaee:facet-name"
+ >[<xsl:value-of select="normalize-space(text())" />]</xsl:for-each>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- uncomment this code to help debug the skip functionality: -->
+ <!--xsl:comment>
+ Skip is: <xsl:value-of select="$skip" />
+ </xsl:comment-->
+ <xsl:for-each select="$component/javaee:facet">
+ <xsl:variable name="searchFor">[<xsl:value-of
+ select="normalize-space(javaee:facet-name/text())"/>]</xsl:variable>
+ <!-- Do not include this element if it is overridden in the sub-type -->
+ <xsl:if
+ test="not(contains($skip, $searchFor))">
+ <xsl:apply-templates select="." />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component[javaee:component-extension/mfp:component-supertype]"
+ priority="1" >
+ <xsl:element name="component" >
+ <xsl:apply-templates select="javaee:description" />
+ <xsl:apply-templates select="javaee:display-name" />
+ <xsl:apply-templates select="javaee:icon" />
+ <xsl:apply-templates select="javaee:component-type" />
+ <xsl:apply-templates select="javaee:component-class" />
+ <xsl:call-template name="apply-facet-templates" >
+ <xsl:with-param name="component" select="." />
+ </xsl:call-template>
+ <xsl:call-template name="apply-attribute-templates" >
+ <xsl:with-param name="component" select="." />
+ </xsl:call-template>
+ <xsl:call-template name="apply-property-templates" >
+ <xsl:with-param name="component" select="." />
+ </xsl:call-template>
+ <xsl:apply-templates select="javaee:component-extension" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:application" >
+ <xsl:element name="application" >
+ <xsl:apply-templates select="javaee:action-listener[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:default-render-kit-id" />
+ <xsl:apply-templates select="javaee:message-bundle[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:view-handler[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:state-manager[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:navigation-handler[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:el-resolver[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:property-resolver[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:variable-resolver[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:locale-config" />
+ <xsl:apply-templates select="javaee:resource-bundle" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:action-listener" >
+ <xsl:element name="action-listener" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:default-render-kit-id" >
+ <xsl:element name="default-render-kit-id" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:message-bundle" >
+ <xsl:element name="message-bundle" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:navigation-handler" >
+ <xsl:element name="navigation-handler" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:view-handler" >
+ <xsl:element name="view-handler" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:state-manager" >
+ <xsl:element name="state-manager" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:el-resolver" >
+ <xsl:element name="el-resolver" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:property-resolver" >
+ <xsl:element name="property-resolver" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:variable-resolver" >
+ <xsl:element name="variable-resolver" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:locale-config" >
+ <xsl:element name="locale-config" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:factory" >
+ <xsl:element name="factory" >
+ <xsl:apply-templates select="javaee:application-factory[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:faces-context-factory[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:lifecycle-factory[contains(text(), $packageContains)]" />
+ <xsl:apply-templates select="javaee:render-kit-factory[contains(text(), $packageContains)]" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:application-factory" >
+ <xsl:element name="application-factory" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:faces-context-factory" >
+ <xsl:element name="faces-context-factory" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:lifecycle-factory" >
+ <xsl:element name="lifecycle-factory" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:render-kit-factory" >
+ <xsl:element name="render-kit-factory" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component" >
+ <xsl:element name="component" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component-type" >
+ <xsl:element name="component-type" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component-class" >
+ <xsl:element name="component-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component/javaee:facet[1]" priority="1" >
+ <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> facets</xsl:comment>
+ <xsl:element name="facet" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:facet" >
+ <xsl:element name="facet" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:facet-name" >
+ <xsl:element name="facet-name" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:facet-extension">
+ <!-- Make sure not empty -->
+ <xsl:if test="*">
+ <xsl:element name="facet-extension">
+ <!-- Check for possible children of the metadata -->
+ <xsl:if test="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee']">
+ <xsl:apply-templates select="fmd:facet-metadata"/>
+ <xsl:element name="facet-metadata">
+ <!-- Select metadata children -->
+ <xsl:apply-templates select="mfp:facet-metadata/*[
+ namespace-uri() != 'http://java.sun.com/xml/ns/javaee']" />
+ <!-- Add non-metadata children under the metadata -->
+ <xsl:apply-templates select="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
+ and namespace-uri() != 'http://java.sun.com/xml/ns/javaee/faces/design-time-metadata'
+ and (
+ namespace-uri() != 'http://myfaces.apache.org/maven-faces-plugin'
+ or name() != 'mfp:facet-metadata'
+ )]" />
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template match="//javaee:component/javaee:attribute[1]" priority="1" >
+ <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> attributes</xsl:comment>
+ <xsl:element name="attribute" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component/javaee:attribute[1]" priority="1" >
+ <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> attributes</xsl:comment>
+ <xsl:element name="attribute" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:attribute" >
+ <xsl:element name="attribute" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:attribute-name" >
+ <xsl:element name="attribute-name" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:attribute-class" >
+ <xsl:element name="attribute-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:attribute-extension" >
+ <xsl:element name="attribute-extension" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component/javaee:property[1]" priority="1" >
+ <xsl:comment><xsl:value-of select="parent::node()/javaee:component-type/text()" /> properties</xsl:comment>
+ <xsl:element name="property" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:property[javaee:property-name/text() = 'binding']" priority='2' >
+ <!-- skip over properties named 'binding' -->
+ </xsl:template>
+
+ <xsl:template match="//javaee:property" >
+ <xsl:element name="property" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:property-name" >
+ <xsl:element name="property-name" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:property-class" >
+ <xsl:element name="property-class" >
+ <!-- eliminate generics for 1.4-based classes in JSF 1.1 -->
+ <xsl:choose>
+ <xsl:when test="contains(text(), '<')" >
+ <xsl:value-of select="substring-before(text(), '<')" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="text()" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:property-extension">
+ <!-- Make sure not empty -->
+ <xsl:if test="*">
+ <xsl:element name="property-extension">
+ <!-- Check for possible children of the metadata -->
+ <xsl:if test="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee']">
+ <xsl:apply-templates select="fmd:property-metadata"/>
+ <xsl:element name="property-metadata">
+ <!-- Select metadata children -->
+ <xsl:apply-templates select="mfp:property-metadata/*[
+ namespace-uri() != 'http://java.sun.com/xml/ns/javaee']" />
+ <!-- Add non-metadata children under the metadata -->
+ <xsl:apply-templates select="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
+ and namespace-uri() != 'http://java.sun.com/xml/ns/javaee/faces/design-time-metadata'
+ and (
+ namespace-uri() != 'http://myfaces.apache.org/maven-faces-plugin'
+ or name() != 'mfp:property-metadata'
+ )]" />
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- this templates grabs the component-family from an ancestor -->
+ <xsl:template match="//javaee:component-extension[mfp:component-supertype]" priority="1" >
+ <xsl:variable name="componentSupertype"
+ select="mfp:component-supertype/text()" />
+ <xsl:element name="component-extension" >
+ <xsl:element name="component-family">
+ <xsl:value-of select="key('component-type', $componentSupertype)/javaee:component-extension/mfp:component-family/text()" />
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component-extension[mfp:component-family]" priority="2" >
+ <xsl:element name="component-extension" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component-extension" >
+ <xsl:comment>Warning: this component has no component-family!</xsl:comment>
+ <xsl:element name="component-extension" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//mfp:component-metadata" >
+ <xsl:element name="component-metadata" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:converter" >
+ <xsl:element name="converter" >
+ <!-- xsl:apply-templates/ TODO use this instead -->
+ <xsl:apply-templates select="javaee:description"/>
+ <xsl:apply-templates select="javaee:display-name"/>
+ <xsl:apply-templates select="javaee:converter-id"/>
+ <xsl:apply-templates select="javaee:converter-for-class"/>
+ <xsl:apply-templates select="javaee:converter-class"/>
+ <xsl:apply-templates select="javaee:property"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:converter-id" >
+ <xsl:element name="converter-id" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:converter-for-class" >
+ <xsl:element name="converter-for-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:converter-class" >
+ <xsl:element name="converter-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:managed-bean" >
+ <xsl:element name="managed-bean" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:managed-bean-name" >
+ <xsl:element name="managed-bean-name" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:managed-bean-class" >
+ <xsl:element name="managed-bean-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:managed-bean-scope" >
+ <xsl:element name="managed-bean-scope" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:managed-property" >
+ <xsl:element name="managed-property" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:null-value" >
+ <xsl:element name="null-value" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:value" >
+ <xsl:element name="value" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:map-entries" >
+ <xsl:element name="map-entries" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:map-entry" >
+ <xsl:element name="map-entry" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:key" >
+ <xsl:element name="key" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:key-class" >
+ <xsl:element name="key-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:value-class" >
+ <xsl:element name="value-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:message-bundle" >
+ <xsl:element name="message-bundle" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:list-entries" >
+ <xsl:element name="list-entries" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:navigation-rule" >
+ <xsl:element name="navigation-rule" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:from-view-id" >
+ <xsl:element name="from-view-id" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:navigation-case" >
+ <xsl:element name="navigation-case" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:from-action" >
+ <xsl:element name="from-action" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:from-outcome" >
+ <xsl:element name="from-outcome" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:to-view-id" >
+ <xsl:element name="to-view-id" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:redirect" >
+ <xsl:element name="redirect" />
+ </xsl:template>
+
+ <xsl:template match="//javaee:referenced-bean" >
+ <xsl:element name="referenced-bean" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:referenced-bean-name" >
+ <xsl:element name="referenced-bean-name" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:referenced-bean-class" >
+ <xsl:element name="referenced-bean-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:render-kit" >
+ <xsl:element name="render-kit" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:render-kit-id" >
+ <xsl:element name="render-kit-id" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:render-kit-class" >
+ <xsl:element name="render-kit-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+<!-- TODO: flatten component properties into renderer as attributes -->
+<!--
+ <xsl:template match="//javaee:renderer[javaee:renderer-extension/mfp:component-type]"
+ priority="1" >
+ <xsl:element name="renderer" >
+ <xsl:apply-templates select="javaee:component-family" />
+ <xsl:apply-templates select="javaee:renderer-type" />
+ <xsl:apply-templates select="javaee:renderer-class" />
+ <xsl:variable name="componentType" select="javaee:renderer-extension/mfp:component-type/text()" />
+ <xsl:for-each select="key('component-type', $componentType)/javaee:property" >
+ <xsl:element name="attribute" >
+ <xsl:apply-templates select="javaee:description" />
+ <xsl:apply-templates select="javaee:display-name" />
+ <xsl:apply-templates select="javaee:icon" />
+ <xsl:element name="attribute-name" >
+ <xsl:value-of select="javaee:property-name" />
+ </xsl:element>
+ <xsl:element name="attribute-class" >
+ <xsl:value-of select="javaee:property-class" />
+ </xsl:element>
+ <xsl:apply-templates select="javaee:default-value" />
+ <xsl:apply-templates select="javaee:suggested-value" />
+ <xsl:element name="attribute-extension" >
+ <xsl:apply-templates select="mfp:property-extension/*" />
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="javaee:attribute" />
+ <xsl:apply-templates select="javaee:renderer-extension" />
+ </xsl:element>
+ </xsl:template>
+-->
+
+ <xsl:template match="//javaee:renderer" >
+ <xsl:element name="renderer" >
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:component-family" >
+ <xsl:element name="component-family" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:renderer-type" >
+ <xsl:element name="renderer-type" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:renderer-class" >
+ <xsl:element name="renderer-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:renderer-extension[mfp:unsupported-agents]" >
+ <xsl:element name="renderer-extension" >
+ <xsl:element name="renderer-metadata" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:lifecycle" >
+ <xsl:element name="lifecycle" >
+ <xsl:apply-templates select="javaee:phase-listener[contains(text(), $packageContains)]" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:phase-listener" >
+ <xsl:element name="phase-listener" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:default-locale" >
+ <xsl:element name="default-locale" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:supported-locale" >
+ <xsl:element name="supported-locale" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:validator" >
+ <xsl:element name="validator" >
+ <!-- xsl:apply-templates/ TODO use this instead -->
+ <xsl:apply-templates select="javaee:display-name"/>
+ <xsl:apply-templates select="javaee:validator-id"/>
+ <xsl:apply-templates select="javaee:validator-class"/>
+ <xsl:apply-templates select="javaee:property"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:validator-id" >
+ <xsl:element name="validator-id" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:validator-class" >
+ <xsl:element name="validator-class" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:description" >
+ <xsl:element name="description" >
+ <xsl:apply-templates select="@*" />
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template
+ match="//javaee:property[javaee:property-extension/mfp:long-description]/javaee:description"
+ priority="1">
+ <xsl:element name="description" >
+ <xsl:apply-templates select="../javaee:property-extension/mfp:long-description/@*" />
+ <xsl:value-of select="../javaee:property-extension/mfp:long-description/text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:description/@xml:lang" >
+ <xsl:attribute name="xml:lang" ><xsl:value-of select="@xml:lang" /></xsl:attribute>
+ </xsl:template>
+
+ <xsl:template match="//javaee:display-name" >
+ <xsl:element name="display-name" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:icon" >
+ <xsl:element name="icon" >
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:small-icon" >
+ <xsl:element name="small-icon" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:large-icon" >
+ <xsl:element name="large-icon" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:default-value" >
+ <xsl:element name="default-value" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:suggested-value" >
+ <xsl:element name="suggested-value" >
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//mfp:property-values">
+ <!-- Rename this element -->
+ <xsl:element name="attribute-values">
+ <xsl:value-of select="text()" />
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Handle metadata we do not know about by letting it through. Currently,
+ just for property-extension and component-metadata, but should be global.
+ See JIRA issues ADFFACES-358, ADFFACES-361 and ADFFACES-472 -->
+ <xsl:template match="javaee:property-extension/*[
+ namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
+ and namespace-uri() !='http://myfaces.apache.org/maven-faces-plugin'
+ and namespace-uri() !='http://java.sun.com/xml/ns/javaee/faces/design-time-metadata']">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ <xsl:value-of select="text()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="mfp:component-metadata/*[
+ namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
+ and namespace-uri() !='http://myfaces.apache.org/maven-faces-plugin']">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ <xsl:value-of select="text()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="//*[
+ namespace-uri() = 'http://myfaces.apache.org/maven-faces-plugin']"
+ priority="-1">
+ <xsl:element name="{local-name()}" >
+ <xsl:apply-templates select="@*|node()"/>
+ <xsl:value-of select="text()"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Rule for the jsr-276 (top level) component metadata, just copy the whole thing -->
+ <xsl:template match="//fmd:component-metadata">
+ <xsl:element name="fmd:component-metadata">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Rule for the jsr-276 (top level) property metadata, just copy the whole thing -->
+ <xsl:template match="//fmd:property-metadata">
+ <xsl:element name="fmd:property-metadata">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Rule for the jsr-276 (top level) facet metadata, just copy the whole thing -->
+ <xsl:template match="//fmd:facet-metadata">
+ <xsl:element name="fmd:facet-metadata">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:faces-config-extension">
+ <xsl:apply-templates select="fmd:global-metadata"/>
+ </xsl:template>
+
+ <!-- Rule for the jsr-276 (top level) global metadata extension -->
+ <xsl:template match="//fmd:global-metadata">
+ <xsl:element name="faces-config-extension">
+ <xsl:element name="fmd:global-metadata">
+ <xsl:apply-templates select="fmd:contract-definitions"/>
+ <xsl:apply-templates select="fmd:component-category-definitions"/>
+ <xsl:apply-templates select="fmd:property-category-definitions"/>
+ <xsl:apply-templates select="fmd:faces-taglib-definitions"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:contract-definitions">
+ <xsl:element name="fmd:contract-definitions">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:component-category-definitions">
+ <xsl:element name="fmd:component-category-definitions">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:property-category-definitions">
+ <xsl:element name="fmd:property-category-definitions">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:faces-taglib-definitions">
+ <xsl:element name="fmd:faces-taglib-definitions">
+ <xsl:apply-templates select="fmd:faces-taglib"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:faces-taglib">
+ <xsl:element name="fmd:faces-taglib">
+ <xsl:copy-of select="*"/>
+ <xsl:variable name="tagPrefix" select="fmd:short-name/text()"/>
+ <xsl:apply-templates select="*"/>
+ <xsl:for-each select="//javaee:validator">
+ <xsl:if test="starts-with(javaee:validator-extension/mfp:tag-name/text(), $tagPrefix)" >
+ <xsl:element name="fmd:tag">
+ <xsl:element name="fmd:name">
+ <xsl:value-of select="substring-after(javaee:validator-extension/mfp:tag-name/text(), ':')"/>
+ </xsl:element>
+ <xsl:element name="fmd:validator-id">
+ <xsl:value-of select="javaee:validator-id/text()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="//javaee:converter" >
+ <xsl:if test="starts-with(javaee:converter-extension/mfp:tag-name/text(), $tagPrefix)" >
+ <xsl:element name="fmd:tag">
+ <xsl:element name="fmd:name">
+ <xsl:value-of select="substring-after(javaee:converter-extension/mfp:tag-name/text(), ':')"/>
+ </xsl:element>
+ <xsl:element name="fmd:converter-id">
+ <xsl:value-of select="javaee:converter-id/text()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="//javaee:component" >
+ <xsl:if test="starts-with(javaee:component-extension/mfp:tag-name/text(), $tagPrefix)" >
+ <xsl:element name="fmd:tag">
+ <xsl:element name="fmd:name">
+ <xsl:value-of select="substring-after(javaee:component-extension/mfp:tag-name/text(), ':')"/>
+ </xsl:element>
+ <xsl:element name="fmd:component-type">
+ <xsl:value-of select="javaee:component-type/text()"/>
+ </xsl:element>
+ <xsl:element name="fmd:renderer-type">
+ <xsl:value-of select="javaee:component-extension/mfp:renderer-type/text()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Blacklisted mfp: that should not be copied over into the faces-config.xml: -->
+ <xsl:template match="//mfp:alternate-class" />
+ <xsl:template match="//mfp:author" />
+ <xsl:template match="//mfp:component-metadata/mfp:group" />
+ <xsl:template match="//mfp:component-superclass" />
+ <xsl:template match="//mfp:component-supertype" />
+ <xsl:template match="//mfp:event" />
+ <xsl:template match="//mfp:example" />
+ <xsl:template match="//mfp:implementation-type" />
+ <xsl:template match="//mfp:java-constructor" />
+ <xsl:template match="//mfp:javadoc-tags" />
+ <xsl:template match="//mfp:javascript-class" />
+ <xsl:template match="//mfp:jsp-property-name" />
+ <xsl:template match="//mfp:long-description" />
+ <xsl:template match="//mfp:method-binding-signature" />
+ <xsl:template match="//mfp:screenshot" />
+ <xsl:template match="//mfp:short-description" />
+ <xsl:template match="//mfp:state-holder" />
+ <xsl:template match="//mfp:tag-attribute-excluded" />
+ <xsl:template match="//mfp:tag-class" />
+ <xsl:template match="//mfp:tag-class-modifier" />
+ <xsl:template match="//mfp:tag-name" />
+ <xsl:template match="//mfp:uix2-local-name" />
+ <xsl:template match="//mfp:unsupported-render-kit" />
+ <xsl:template match="//mfp:unsupported-render-kits" />
+ <xsl:template match="//mfp:use-max-time" />
+ <xsl:template match="//mfp:warn-if-not-specified" />
+
+</xsl:stylesheet>
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 13/17: Fix windows new-line endings
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 98d291f002b35511f7d4bc28baa10b20aedfe6c7
Author: Andrew Robinson <ar...@apache.org>
AuthorDate: Sat Jul 11 20:50:46 2009 +0000
Fix windows new-line endings
---
.../taglib/AbstractConverterTagGenerator.java | 386 ++++++-------
.../generator/taglib/AbstractTagGenerator.java | 532 +++++++++---------
.../taglib/AbstractValidatorTagGenerator.java | 390 +++++++-------
.../taglib/MyFacesConverterTagGenerator.java | 334 ++++++------
.../taglib/MyFacesValidatorTagGenerator.java | 322 +++++------
.../taglib/TrinidadConverterTagGenerator.java | 334 ++++++------
.../taglib/TrinidadValidatorTagGenerator.java | 354 ++++++------
.../plugin/faces/parse/AbstractTagBean.java | 600 ++++++++++-----------
.../plugin/faces/parse/ExampleBean.java | 182 +++----
.../plugin/i18n/uixtools/LocaleDataResolver.java | 322 +++++------
.../plugin/jdeveloper/TldContentHandler.java | 466 ++++++++--------
11 files changed, 2111 insertions(+), 2111 deletions(-)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java
index 6b4788f..e54265a 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractConverterTagGenerator.java
@@ -1,193 +1,193 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
-
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ConverterBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
-import org.apache.maven.plugin.logging.Log;
-
-import java.io.File;
-import java.io.StringWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Set;
-import java.util.Iterator;
-
-public abstract class AbstractConverterTagGenerator extends AbstractTagGenerator {
- protected AbstractConverterTagGenerator(boolean is12, String licenseHeader, Log log) {
- super(is12, licenseHeader, log);
- }
-
- public void generateTagHandler(
- ConverterBean converter, File generatedSourceDirectory)
- {
- try
- {
- getLog().debug("Generating " + converter.getTagClass());
-
- StringWriter sw = new StringWriter();
- PrettyWriter out = new PrettyWriter(sw);
-
- Set imports = createImports(converter);
- writeHeader(out, converter, imports);
-
- writeClass(out, converter);
-
- writeConstructor(out, converter);
-
- writePropertyMethods(out, converter);
- writeDoStartTag(out, converter);
- writeCreateConverter(out, converter);
- writeSetProperties(out, converter);
- writeRelease(out, converter);
-
- writeEnd(out);
- // delay write in case of error
- // timestamp should not be updated when an error occurs
- // delete target file first, because it is readonly
- File targetFile = createFile(generatedSourceDirectory, converter.getTagClass());
- targetFile.delete();
- FileWriter fw = new FileWriter(targetFile);
- StringBuffer buf = sw.getBuffer();
- fw.write(buf.toString());
- fw.close();
- targetFile.setReadOnly();
- }
- catch (Throwable e)
- {
- getLog().error("Error generating " + converter.getTagClass(), e);
- }
- }
-
- protected abstract Set createImports(ConverterBean converter);
- protected abstract void writeSetProperty(PrettyWriter out, PropertyBean property);
-
-
- private void writeSetProperties(
- PrettyWriter out,
- ConverterBean converter) throws IOException
- {
- Iterator properties = converter.properties();
- properties = new FilteredIterator(properties, new TagAttributeFilter());
- if (properties.hasNext())
- {
- String converterFullClass = converter.getConverterClass();
- String converterClass = Util.getClassFromFullClass(converterFullClass);
- out.println();
- out.println("private void _setProperties(");
- out.indent();
- out.println(converterClass + " converter) throws JspException");
- out.unindent();
- out.println("{");
- out.indent();
- while (properties.hasNext())
- {
- PropertyBean property = (PropertyBean)properties.next();
- writeSetProperty(out, property);
- }
- out.unindent();
- out.println("}");
- }
- }
-
- protected void writeCreateConverter(
- PrettyWriter out,
- ConverterBean converter) throws IOException
- {
- Iterator properties = converter.properties();
- properties = new FilteredIterator(properties, new TagAttributeFilter());
-
- String converterFullClass = converter.getConverterClass();
- String converterClass = Util.getClassFromFullClass(converterFullClass);
-
- out.println();
- // TODO: restore coding standards, and make final
- if (is12()) {
- out.println("@Override");
- }
- out.println("protected Converter createConverter() throws JspException");
- out.println("{");
- out.indent();
- if (is12())
- {
- out.println("String converterId = " + converterClass + ".CONVERTER_ID;");
- out.println("Application appl = FacesContext.getCurrentInstance().getApplication();");
- out.println(converterClass + " converter = " +
- "(" + converterClass + ")appl.createConverter(converterId);");
- }
- else
- {
- out.println(converterClass + " converter = " +
- "(" + converterClass + ")super.createConverter();");
- }
- if (properties.hasNext())
- {
- out.println("_setProperties(converter);");
- }
- out.println("return converter;");
- out.unindent();
- out.println("}");
-
- }
-
-
- protected void writeDoStartTag(
- PrettyWriter out,
- ConverterBean converter) throws IOException
- {
- if (!is12())
- {
- String converterFullClass = converter.getConverterClass();
- String converterClass = Util.getClassFromFullClass(converterFullClass);
-
- out.println();
- // TODO: restore coding standards, and make final
- out.println("@Override");
- out.println("public int doStartTag() throws JspException");
- out.println("{");
- out.indent();
- out.println("super.setConverterId(" + converterClass + ".CONVERTER_ID);");
- out.println("return super.doStartTag();");
- out.unindent();
- out.println("}");
- }
- }
-
-
- private void writeClass(PrettyWriter out, AbstractTagBean abstractTag) {
- String className = Util.getClassFromFullClass(abstractTag.getTagClass());
- if (is12())
- {
- out.println("public class " + className +
- " extends ConverterELTag");
- }
- else
- {
- out.println("public class " + className +
- " extends ConverterTag");
- }
-
- out.println("{");
- out.indent();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ConverterBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
+import org.apache.maven.plugin.logging.Log;
+
+import java.io.File;
+import java.io.StringWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Set;
+import java.util.Iterator;
+
+public abstract class AbstractConverterTagGenerator extends AbstractTagGenerator {
+ protected AbstractConverterTagGenerator(boolean is12, String licenseHeader, Log log) {
+ super(is12, licenseHeader, log);
+ }
+
+ public void generateTagHandler(
+ ConverterBean converter, File generatedSourceDirectory)
+ {
+ try
+ {
+ getLog().debug("Generating " + converter.getTagClass());
+
+ StringWriter sw = new StringWriter();
+ PrettyWriter out = new PrettyWriter(sw);
+
+ Set imports = createImports(converter);
+ writeHeader(out, converter, imports);
+
+ writeClass(out, converter);
+
+ writeConstructor(out, converter);
+
+ writePropertyMethods(out, converter);
+ writeDoStartTag(out, converter);
+ writeCreateConverter(out, converter);
+ writeSetProperties(out, converter);
+ writeRelease(out, converter);
+
+ writeEnd(out);
+ // delay write in case of error
+ // timestamp should not be updated when an error occurs
+ // delete target file first, because it is readonly
+ File targetFile = createFile(generatedSourceDirectory, converter.getTagClass());
+ targetFile.delete();
+ FileWriter fw = new FileWriter(targetFile);
+ StringBuffer buf = sw.getBuffer();
+ fw.write(buf.toString());
+ fw.close();
+ targetFile.setReadOnly();
+ }
+ catch (Throwable e)
+ {
+ getLog().error("Error generating " + converter.getTagClass(), e);
+ }
+ }
+
+ protected abstract Set createImports(ConverterBean converter);
+ protected abstract void writeSetProperty(PrettyWriter out, PropertyBean property);
+
+
+ private void writeSetProperties(
+ PrettyWriter out,
+ ConverterBean converter) throws IOException
+ {
+ Iterator properties = converter.properties();
+ properties = new FilteredIterator(properties, new TagAttributeFilter());
+ if (properties.hasNext())
+ {
+ String converterFullClass = converter.getConverterClass();
+ String converterClass = Util.getClassFromFullClass(converterFullClass);
+ out.println();
+ out.println("private void _setProperties(");
+ out.indent();
+ out.println(converterClass + " converter) throws JspException");
+ out.unindent();
+ out.println("{");
+ out.indent();
+ while (properties.hasNext())
+ {
+ PropertyBean property = (PropertyBean)properties.next();
+ writeSetProperty(out, property);
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ protected void writeCreateConverter(
+ PrettyWriter out,
+ ConverterBean converter) throws IOException
+ {
+ Iterator properties = converter.properties();
+ properties = new FilteredIterator(properties, new TagAttributeFilter());
+
+ String converterFullClass = converter.getConverterClass();
+ String converterClass = Util.getClassFromFullClass(converterFullClass);
+
+ out.println();
+ // TODO: restore coding standards, and make final
+ if (is12()) {
+ out.println("@Override");
+ }
+ out.println("protected Converter createConverter() throws JspException");
+ out.println("{");
+ out.indent();
+ if (is12())
+ {
+ out.println("String converterId = " + converterClass + ".CONVERTER_ID;");
+ out.println("Application appl = FacesContext.getCurrentInstance().getApplication();");
+ out.println(converterClass + " converter = " +
+ "(" + converterClass + ")appl.createConverter(converterId);");
+ }
+ else
+ {
+ out.println(converterClass + " converter = " +
+ "(" + converterClass + ")super.createConverter();");
+ }
+ if (properties.hasNext())
+ {
+ out.println("_setProperties(converter);");
+ }
+ out.println("return converter;");
+ out.unindent();
+ out.println("}");
+
+ }
+
+
+ protected void writeDoStartTag(
+ PrettyWriter out,
+ ConverterBean converter) throws IOException
+ {
+ if (!is12())
+ {
+ String converterFullClass = converter.getConverterClass();
+ String converterClass = Util.getClassFromFullClass(converterFullClass);
+
+ out.println();
+ // TODO: restore coding standards, and make final
+ out.println("@Override");
+ out.println("public int doStartTag() throws JspException");
+ out.println("{");
+ out.indent();
+ out.println("super.setConverterId(" + converterClass + ".CONVERTER_ID);");
+ out.println("return super.doStartTag();");
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+
+ private void writeClass(PrettyWriter out, AbstractTagBean abstractTag) {
+ String className = Util.getClassFromFullClass(abstractTag.getTagClass());
+ if (is12())
+ {
+ out.println("public class " + className +
+ " extends ConverterELTag");
+ }
+ else
+ {
+ out.println("public class " + className +
+ " extends ConverterTag");
+ }
+
+ out.println("{");
+ out.indent();
+ }
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
index eb6ec9b..ada75f2 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractTagGenerator.java
@@ -1,266 +1,266 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
-
-import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.generator.GeneratorHelper;
-import org.apache.maven.plugin.logging.Log;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-
-public abstract class AbstractTagGenerator {
- protected Log _log;
- protected boolean _is12;
- protected String _licenseHeader;
- static final private String _AUTO_GENERATE_WARNING =
-"// WARNING: This file was automatically generated. Do not edit it directly,\n"+
-"// or you will lose your changes.\n\n";
-
- public AbstractTagGenerator(boolean is12, String licenseHeader, Log log) {
- this._log = log;
- this._licenseHeader = licenseHeader;
- this._is12 = is12;
- }
-
- protected void writePreamble(
- PrettyWriter out)
- {
- out.write(_AUTO_GENERATE_WARNING);
- out.write(_licenseHeader);
- }
-
- protected Log getLog() {
- return _log;
- }
-
- protected boolean is12() {
- return _is12;
- }
-
- protected File createFile(File generatedSourceDirectory, String fullClassName) {
- getLog().debug("Generating " + fullClassName);
- String sourcePath = Util.convertClassToSourcePath(fullClassName, ".java");
- File targetFile = new File(generatedSourceDirectory, sourcePath);
-
- targetFile.getParentFile().mkdirs();
- return targetFile;
- }
-
- protected void writeConstructor(
- PrettyWriter out,
- AbstractTagBean abstractTag) throws IOException
- {
- String fullClassName = abstractTag.getTagClass();
- String className = Util.getClassFromFullClass(fullClassName);
- out.println();
- out.println("/**");
- // TODO: restore this correctly phrased comment (tense vs. command)
- //out.println(" * Constructs an instance of " + className + ".");
- out.println(" * Construct an instance of the " + className + ".");
- out.println(" */");
- out.println("public " + className + "()");
- out.println("{");
- out.println("}");
- }
-
- protected void writePropertyMethods(
- PrettyWriter out,
- AbstractTagBean abstractTag) throws IOException
- {
- Iterator properties = abstractTag.properties();
- properties = new FilteredIterator(properties, new TagAttributeFilter());
- while (properties.hasNext())
- {
- PropertyBean property = (PropertyBean)properties.next();
- out.println();
- writePropertyMember(out, property);
- writePropertySet(out, property);
- }
- }
- private void writePropertyMember(
- PrettyWriter out,
- PropertyBean property) throws IOException
- {
- String propName = property.getPropertyName();
- String propVar = "_" + Util.getVariableFromName(propName);
- String jspPropType = getJspPropertyType(property);
-
- out.println("private " + jspPropType + " " + propVar + ";");
- }
-
- private void writePropertySet(
- PrettyWriter out,
- PropertyBean property) throws IOException
- {
- String propName = property.getPropertyName();
- String propVar = Util.getVariableFromName(propName);
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- String jspPropType = getJspPropertyType(property);
-
- // TODO: restore coding standards, and make final
- out.println("public void " + setMethod + "(" + jspPropType + " " + propVar + ")");
- out.println("{");
- out.indent();
- out.println("_" + propVar + " = " + propVar + ";");
- out.unindent();
- out.println("}");
- }
-
- protected void writeRelease(
- PrettyWriter out,
- AbstractTagBean abstractTag) throws IOException
- {
- Iterator properties = abstractTag.properties();
- properties = new FilteredIterator(properties, new TagAttributeFilter());
- if (properties.hasNext())
- {
- out.println();
- if (is12()) {
- out.println("@Override");
- }
- out.println("public void release()");
- out.println("{");
- out.indent();
- out.println("super.release();");
- while (properties.hasNext())
- {
- PropertyBean property = (PropertyBean)properties.next();
- String propName = property.getPropertyName();
- String propVar = "_" + Util.getVariableFromName(propName);
- out.println(propVar + " = null;");
- }
- out.unindent();
- out.println("}");
- }
- }
-
- private String getJspPropertyType(PropertyBean property)
- {
- if (property.isMethodExpression())
- return "MethodExpression";
-
- if (is12() && property.isMethodBinding())
- return "MethodExpression";
-
- if (is12() && !property.isLiteralOnly())
- return "ValueExpression";
- return "String";
- }
-
- protected void writeEnd(PrettyWriter out) {
- out.unindent();
- out.println("}");
- out.close();
- }
-
- protected void writeImports(
- PrettyWriter out,
- AbstractTagBean abstractTagBean, Set imports)
- {
-
- // do not import implicit!
- imports.removeAll(Util.PRIMITIVE_TYPES);
-
- String packageName = Util.getPackageFromFullClass(abstractTagBean.getTagClass());
- GeneratorHelper.writeImports(out, packageName, imports);
- }
-
- protected final void writeHeader(PrettyWriter out, AbstractTagBean converter, Set imports) {
- String packageName = Util.getPackageFromFullClass(converter.getTagClass());
- // header/copyright
- writePreamble(out);
-
- // package
- out.println("package " + packageName + ";");
-
- out.println();
- writeImports(out, converter, imports);
-
- out.println("/**");
- // TODO: remove this blank line.
- out.println();
- out.println(" * Auto-generated tag class.");
- out.println(" */");
- }
-
- protected void addImportsFromPropertes(AbstractTagBean abstractTagBean, Set imports) {
- Iterator properties = abstractTagBean.properties();
- properties = new FilteredIterator(properties, new TagAttributeFilter());
-
- while (properties.hasNext())
- {
- PropertyBean property = (PropertyBean)properties.next();
-
- String propertyClass = property.getPropertyClass();
- if (propertyClass != null)
- imports.add(propertyClass);
-
- if ("java.lang.String[]".equals(propertyClass))
- {
- imports.add("java.text.ParseException");
- }
- }
- }
-
- protected String resolveDateType(String className, boolean useMaxTime)
- {
- String type = (String)_RESOLVABLE_TYPES.get(className);
- return useMaxTime ? type + "WithMaxTime" : type;
- }
-
- protected String resolveType(String className)
- {
- return (String)_RESOLVABLE_TYPES.get(className);
- }
-
- // TODO: for everything but Locale, String[], Date, and TimeZone,
- // in JSF 1.2 we should already be going through coercion, and
- // not need any of the "TagUtils" functions
- private Map _createResolvableTypes()
- {
- Map resolvableTypes = new HashMap();
-
- resolvableTypes.put("boolean", "Boolean");
- resolvableTypes.put("char", "Character");
- resolvableTypes.put("java.util.Date", "Date");
- resolvableTypes.put("int", "Integer");
- resolvableTypes.put("float", "Float");
- resolvableTypes.put("double", "Double");
- resolvableTypes.put("java.util.Locale", "Locale");
- resolvableTypes.put("long", "Long");
- resolvableTypes.put("java.lang.String", "String");
- resolvableTypes.put("java.lang.String[]", "StringArray");
- resolvableTypes.put("java.util.TimeZone", "TimeZone");
-
- return Collections.unmodifiableMap(resolvableTypes);
- }
-
- final private Map _RESOLVABLE_TYPES = _createResolvableTypes();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.generator.GeneratorHelper;
+import org.apache.maven.plugin.logging.Log;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+
+public abstract class AbstractTagGenerator {
+ protected Log _log;
+ protected boolean _is12;
+ protected String _licenseHeader;
+ static final private String _AUTO_GENERATE_WARNING =
+"// WARNING: This file was automatically generated. Do not edit it directly,\n"+
+"// or you will lose your changes.\n\n";
+
+ public AbstractTagGenerator(boolean is12, String licenseHeader, Log log) {
+ this._log = log;
+ this._licenseHeader = licenseHeader;
+ this._is12 = is12;
+ }
+
+ protected void writePreamble(
+ PrettyWriter out)
+ {
+ out.write(_AUTO_GENERATE_WARNING);
+ out.write(_licenseHeader);
+ }
+
+ protected Log getLog() {
+ return _log;
+ }
+
+ protected boolean is12() {
+ return _is12;
+ }
+
+ protected File createFile(File generatedSourceDirectory, String fullClassName) {
+ getLog().debug("Generating " + fullClassName);
+ String sourcePath = Util.convertClassToSourcePath(fullClassName, ".java");
+ File targetFile = new File(generatedSourceDirectory, sourcePath);
+
+ targetFile.getParentFile().mkdirs();
+ return targetFile;
+ }
+
+ protected void writeConstructor(
+ PrettyWriter out,
+ AbstractTagBean abstractTag) throws IOException
+ {
+ String fullClassName = abstractTag.getTagClass();
+ String className = Util.getClassFromFullClass(fullClassName);
+ out.println();
+ out.println("/**");
+ // TODO: restore this correctly phrased comment (tense vs. command)
+ //out.println(" * Constructs an instance of " + className + ".");
+ out.println(" * Construct an instance of the " + className + ".");
+ out.println(" */");
+ out.println("public " + className + "()");
+ out.println("{");
+ out.println("}");
+ }
+
+ protected void writePropertyMethods(
+ PrettyWriter out,
+ AbstractTagBean abstractTag) throws IOException
+ {
+ Iterator properties = abstractTag.properties();
+ properties = new FilteredIterator(properties, new TagAttributeFilter());
+ while (properties.hasNext())
+ {
+ PropertyBean property = (PropertyBean)properties.next();
+ out.println();
+ writePropertyMember(out, property);
+ writePropertySet(out, property);
+ }
+ }
+ private void writePropertyMember(
+ PrettyWriter out,
+ PropertyBean property) throws IOException
+ {
+ String propName = property.getPropertyName();
+ String propVar = "_" + Util.getVariableFromName(propName);
+ String jspPropType = getJspPropertyType(property);
+
+ out.println("private " + jspPropType + " " + propVar + ";");
+ }
+
+ private void writePropertySet(
+ PrettyWriter out,
+ PropertyBean property) throws IOException
+ {
+ String propName = property.getPropertyName();
+ String propVar = Util.getVariableFromName(propName);
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ String jspPropType = getJspPropertyType(property);
+
+ // TODO: restore coding standards, and make final
+ out.println("public void " + setMethod + "(" + jspPropType + " " + propVar + ")");
+ out.println("{");
+ out.indent();
+ out.println("_" + propVar + " = " + propVar + ";");
+ out.unindent();
+ out.println("}");
+ }
+
+ protected void writeRelease(
+ PrettyWriter out,
+ AbstractTagBean abstractTag) throws IOException
+ {
+ Iterator properties = abstractTag.properties();
+ properties = new FilteredIterator(properties, new TagAttributeFilter());
+ if (properties.hasNext())
+ {
+ out.println();
+ if (is12()) {
+ out.println("@Override");
+ }
+ out.println("public void release()");
+ out.println("{");
+ out.indent();
+ out.println("super.release();");
+ while (properties.hasNext())
+ {
+ PropertyBean property = (PropertyBean)properties.next();
+ String propName = property.getPropertyName();
+ String propVar = "_" + Util.getVariableFromName(propName);
+ out.println(propVar + " = null;");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ private String getJspPropertyType(PropertyBean property)
+ {
+ if (property.isMethodExpression())
+ return "MethodExpression";
+
+ if (is12() && property.isMethodBinding())
+ return "MethodExpression";
+
+ if (is12() && !property.isLiteralOnly())
+ return "ValueExpression";
+ return "String";
+ }
+
+ protected void writeEnd(PrettyWriter out) {
+ out.unindent();
+ out.println("}");
+ out.close();
+ }
+
+ protected void writeImports(
+ PrettyWriter out,
+ AbstractTagBean abstractTagBean, Set imports)
+ {
+
+ // do not import implicit!
+ imports.removeAll(Util.PRIMITIVE_TYPES);
+
+ String packageName = Util.getPackageFromFullClass(abstractTagBean.getTagClass());
+ GeneratorHelper.writeImports(out, packageName, imports);
+ }
+
+ protected final void writeHeader(PrettyWriter out, AbstractTagBean converter, Set imports) {
+ String packageName = Util.getPackageFromFullClass(converter.getTagClass());
+ // header/copyright
+ writePreamble(out);
+
+ // package
+ out.println("package " + packageName + ";");
+
+ out.println();
+ writeImports(out, converter, imports);
+
+ out.println("/**");
+ // TODO: remove this blank line.
+ out.println();
+ out.println(" * Auto-generated tag class.");
+ out.println(" */");
+ }
+
+ protected void addImportsFromPropertes(AbstractTagBean abstractTagBean, Set imports) {
+ Iterator properties = abstractTagBean.properties();
+ properties = new FilteredIterator(properties, new TagAttributeFilter());
+
+ while (properties.hasNext())
+ {
+ PropertyBean property = (PropertyBean)properties.next();
+
+ String propertyClass = property.getPropertyClass();
+ if (propertyClass != null)
+ imports.add(propertyClass);
+
+ if ("java.lang.String[]".equals(propertyClass))
+ {
+ imports.add("java.text.ParseException");
+ }
+ }
+ }
+
+ protected String resolveDateType(String className, boolean useMaxTime)
+ {
+ String type = (String)_RESOLVABLE_TYPES.get(className);
+ return useMaxTime ? type + "WithMaxTime" : type;
+ }
+
+ protected String resolveType(String className)
+ {
+ return (String)_RESOLVABLE_TYPES.get(className);
+ }
+
+ // TODO: for everything but Locale, String[], Date, and TimeZone,
+ // in JSF 1.2 we should already be going through coercion, and
+ // not need any of the "TagUtils" functions
+ private Map _createResolvableTypes()
+ {
+ Map resolvableTypes = new HashMap();
+
+ resolvableTypes.put("boolean", "Boolean");
+ resolvableTypes.put("char", "Character");
+ resolvableTypes.put("java.util.Date", "Date");
+ resolvableTypes.put("int", "Integer");
+ resolvableTypes.put("float", "Float");
+ resolvableTypes.put("double", "Double");
+ resolvableTypes.put("java.util.Locale", "Locale");
+ resolvableTypes.put("long", "Long");
+ resolvableTypes.put("java.lang.String", "String");
+ resolvableTypes.put("java.lang.String[]", "StringArray");
+ resolvableTypes.put("java.util.TimeZone", "TimeZone");
+
+ return Collections.unmodifiableMap(resolvableTypes);
+ }
+
+ final private Map _RESOLVABLE_TYPES = _createResolvableTypes();
+
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java
index d99de41..bcf7197 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/AbstractValidatorTagGenerator.java
@@ -1,195 +1,195 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
-
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
-import org.apache.maven.plugin.logging.Log;
-
-import java.io.File;
-import java.io.StringWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Set;
-import java.util.Iterator;
-
-public abstract class AbstractValidatorTagGenerator extends AbstractTagGenerator {
-
- public AbstractValidatorTagGenerator(boolean is12, String licenseHeader, Log log) {
- super(is12, licenseHeader, log);
- }
-
- public void generateTagHandler(
- ValidatorBean validator, File generatedSourceDirectory)
- {
-
- try
- {
- getLog().debug("Generating " + validator.getTagClass());
-
- StringWriter sw = new StringWriter();
- PrettyWriter out = new PrettyWriter(sw);
- Set imports = createImports(validator);
- writeHeader(out, validator, imports);
-
- writeClass(out, validator);
-
- writeConstructor(out, validator);
-
- writePropertyMethods(out, validator);
- writeDoStartTag(out, validator);
- writeCreateValidator(out, validator);
- writeSetProperties(out, validator);
- writeRelease(out, validator);
-
- writeEnd(out);
-
- // delay write in case of error
- // timestamp should not be updated when an error occurs
- // delete target file first, because it is readonly
- File targetFile = createFile(generatedSourceDirectory, validator.getTagClass());
- targetFile.delete();
- FileWriter fw = new FileWriter(targetFile);
- StringBuffer buf = sw.getBuffer();
- fw.write(buf.toString());
- fw.close();
- targetFile.setReadOnly();
- }
- catch (Throwable e)
- {
- getLog().error("Error generating " + validator.getTagClass(), e);
- }
- }
-
- protected abstract Set createImports(ValidatorBean validator);
-
- protected void writeClass(PrettyWriter out, AbstractTagBean abstractTag) {
- String className = Util.getClassFromFullClass(abstractTag.getTagClass());
- if (is12())
- {
- out.println("public class " + className +
- " extends ValidatorELTag");
- }
- else
- {
- out.println("public class " + className +
- " extends ValidatorTag");
- }
-
- out.println("{");
- out.indent();
- }
-
- private void writeDoStartTag(
- PrettyWriter out,
- ValidatorBean validator) throws IOException
- {
- out.println();
- if (!is12())
- {
- String validatorFullClass = validator.getValidatorClass();
- String validatorClass = Util.getClassFromFullClass(validatorFullClass);
-
- // TODO: restore coding standards, and make final
- //out.println("@Override");
- out.println("public int doStartTag() throws JspException");
- out.println("{");
- out.indent();
- out.println("super.setValidatorId(" + validatorClass + ".VALIDATOR_ID);");
- out.println("return super.doStartTag();");
- out.unindent();
- out.println("}");
- }
- }
-
-
- private void writeCreateValidator(
- PrettyWriter out,
- ValidatorBean validator) throws IOException
- {
- Iterator properties = validator.properties();
- properties = new FilteredIterator(properties, new TagAttributeFilter());
- if (properties.hasNext())
- {
- String validatorFullClass = validator.getValidatorClass();
- String validatorClass = Util.getClassFromFullClass(validatorFullClass);
-
- out.println();
- // TODO: restore coding standards, and make final
- if (is12()) {
- out.println("@Override");
- }
- out.println("protected Validator createValidator() throws JspException");
- out.println("{");
- out.indent();
- if (is12())
- {
- out.println("String validatorId = " + validatorClass + ".VALIDATOR_ID;");
- out.println("Application appl = FacesContext.getCurrentInstance().getApplication();");
- out.println(validatorClass + " validator = " +
- "(" + validatorClass + ")appl.createValidator(validatorId);");
- }
- else
- {
- out.println(validatorClass + " validator = " +
- "(" + validatorClass + ")super.createValidator();");
- }
- out.println("_setProperties(validator);");
- out.println("return validator;");
- out.unindent();
- out.println("}");
- }
- }
-
- private void writeSetProperties(
- PrettyWriter out,
- ValidatorBean validator) throws IOException
- {
- Iterator properties = validator.properties();
- properties = new FilteredIterator(properties, new TagAttributeFilter());
- if (properties.hasNext())
- {
- String validatorFullClass = validator.getValidatorClass();
- String validatorClass = Util.getClassFromFullClass(validatorFullClass);
- out.println();
- out.println("private void _setProperties(");
- out.indent();
- out.println(validatorClass + " validator) throws JspException");
- out.unindent();
- out.println("{");
- out.indent();
- while (properties.hasNext())
- {
- PropertyBean property = (PropertyBean)properties.next();
- writeSetProperty(out, property);
- }
- out.unindent();
- out.println("}");
- }
- }
-
- protected abstract void writeSetProperty(
- PrettyWriter out,
- PropertyBean property);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.AbstractTagBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
+import org.apache.maven.plugin.logging.Log;
+
+import java.io.File;
+import java.io.StringWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Set;
+import java.util.Iterator;
+
+public abstract class AbstractValidatorTagGenerator extends AbstractTagGenerator {
+
+ public AbstractValidatorTagGenerator(boolean is12, String licenseHeader, Log log) {
+ super(is12, licenseHeader, log);
+ }
+
+ public void generateTagHandler(
+ ValidatorBean validator, File generatedSourceDirectory)
+ {
+
+ try
+ {
+ getLog().debug("Generating " + validator.getTagClass());
+
+ StringWriter sw = new StringWriter();
+ PrettyWriter out = new PrettyWriter(sw);
+ Set imports = createImports(validator);
+ writeHeader(out, validator, imports);
+
+ writeClass(out, validator);
+
+ writeConstructor(out, validator);
+
+ writePropertyMethods(out, validator);
+ writeDoStartTag(out, validator);
+ writeCreateValidator(out, validator);
+ writeSetProperties(out, validator);
+ writeRelease(out, validator);
+
+ writeEnd(out);
+
+ // delay write in case of error
+ // timestamp should not be updated when an error occurs
+ // delete target file first, because it is readonly
+ File targetFile = createFile(generatedSourceDirectory, validator.getTagClass());
+ targetFile.delete();
+ FileWriter fw = new FileWriter(targetFile);
+ StringBuffer buf = sw.getBuffer();
+ fw.write(buf.toString());
+ fw.close();
+ targetFile.setReadOnly();
+ }
+ catch (Throwable e)
+ {
+ getLog().error("Error generating " + validator.getTagClass(), e);
+ }
+ }
+
+ protected abstract Set createImports(ValidatorBean validator);
+
+ protected void writeClass(PrettyWriter out, AbstractTagBean abstractTag) {
+ String className = Util.getClassFromFullClass(abstractTag.getTagClass());
+ if (is12())
+ {
+ out.println("public class " + className +
+ " extends ValidatorELTag");
+ }
+ else
+ {
+ out.println("public class " + className +
+ " extends ValidatorTag");
+ }
+
+ out.println("{");
+ out.indent();
+ }
+
+ private void writeDoStartTag(
+ PrettyWriter out,
+ ValidatorBean validator) throws IOException
+ {
+ out.println();
+ if (!is12())
+ {
+ String validatorFullClass = validator.getValidatorClass();
+ String validatorClass = Util.getClassFromFullClass(validatorFullClass);
+
+ // TODO: restore coding standards, and make final
+ //out.println("@Override");
+ out.println("public int doStartTag() throws JspException");
+ out.println("{");
+ out.indent();
+ out.println("super.setValidatorId(" + validatorClass + ".VALIDATOR_ID);");
+ out.println("return super.doStartTag();");
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+
+ private void writeCreateValidator(
+ PrettyWriter out,
+ ValidatorBean validator) throws IOException
+ {
+ Iterator properties = validator.properties();
+ properties = new FilteredIterator(properties, new TagAttributeFilter());
+ if (properties.hasNext())
+ {
+ String validatorFullClass = validator.getValidatorClass();
+ String validatorClass = Util.getClassFromFullClass(validatorFullClass);
+
+ out.println();
+ // TODO: restore coding standards, and make final
+ if (is12()) {
+ out.println("@Override");
+ }
+ out.println("protected Validator createValidator() throws JspException");
+ out.println("{");
+ out.indent();
+ if (is12())
+ {
+ out.println("String validatorId = " + validatorClass + ".VALIDATOR_ID;");
+ out.println("Application appl = FacesContext.getCurrentInstance().getApplication();");
+ out.println(validatorClass + " validator = " +
+ "(" + validatorClass + ")appl.createValidator(validatorId);");
+ }
+ else
+ {
+ out.println(validatorClass + " validator = " +
+ "(" + validatorClass + ")super.createValidator();");
+ }
+ out.println("_setProperties(validator);");
+ out.println("return validator;");
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ private void writeSetProperties(
+ PrettyWriter out,
+ ValidatorBean validator) throws IOException
+ {
+ Iterator properties = validator.properties();
+ properties = new FilteredIterator(properties, new TagAttributeFilter());
+ if (properties.hasNext())
+ {
+ String validatorFullClass = validator.getValidatorClass();
+ String validatorClass = Util.getClassFromFullClass(validatorFullClass);
+ out.println();
+ out.println("private void _setProperties(");
+ out.indent();
+ out.println(validatorClass + " validator) throws JspException");
+ out.unindent();
+ out.println("{");
+ out.indent();
+ while (properties.hasNext())
+ {
+ PropertyBean property = (PropertyBean)properties.next();
+ writeSetProperty(out, property);
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ protected abstract void writeSetProperty(
+ PrettyWriter out,
+ PropertyBean property);
+
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java
index b4c1ff3..0462ed8 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesConverterTagGenerator.java
@@ -1,167 +1,167 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
-
-import org.apache.maven.plugin.logging.Log;
-import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ConverterBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
-
-import java.util.Set;
-import java.util.TreeSet;
-
-public class MyFacesConverterTagGenerator extends AbstractConverterTagGenerator {
-
- public MyFacesConverterTagGenerator(boolean is12, String licenseHeader, Log log) {
- super(is12, licenseHeader, log);
- }
-
- protected Set createImports(ConverterBean converter) {
- Set imports = new TreeSet();
-
- if (is12())
- {
- imports.add("javax.faces.webapp.ConverterELTag");
- imports.add("javax.faces.context.FacesContext");
- imports.add("javax.faces.application.Application");
- }
- else
- {
- imports.add("javax.faces.webapp.ConverterTag");
- }
-
- imports.add("javax.servlet.jsp.JspException");
- imports.add(converter.getConverterClass());
-
- imports.add("javax.faces.convert.Converter");
- if (is12())
- {
- imports.add("javax.el.ValueExpression");
- }
- else
- {
- imports.add("javax.faces.el.ValueBinding");
- }
- imports.add("org.apache.myfaces.commons.util.TagUtils");
-
-
- addImportsFromPropertes(converter, imports);
- return imports;
- }
-
-
-
-
- protected void writeSetProperty(
- PrettyWriter out,
- PropertyBean property)
- {
- String propName = property.getPropertyName();
- String propFullClass = property.getPropertyClass();
- String propClass = Util.getClassFromFullClass(propFullClass);
- String propVar = "_" + Util.getVariableFromName(propName);
-
- out.println("if (" + propVar + " != null)");
- out.println("{");
- out.indent();
-
- if (is12())
- {
- out.println("if (!" + propVar + ".isLiteralText())");
- out.println("{");
- out.indent();
- out.println("converter.setValueExpression(\"" + propName + "\", " +
- propVar + ");");
- out.unindent();
- out.println("}");
- String propType = resolveType(propFullClass);
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
-
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("converter." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
- else
- {
- out.println("if (TagUtils.isValueReference(" + propVar + "))");
- out.println("{");
- out.indent();
- out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
- out.println("converter.setValueBinding(\"" + propName + "\", vb);");
- out.unindent();
- out.println("}");
- String propType = resolveType(propFullClass);
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("converter." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
-
- out.unindent();
- out.println("}");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ConverterBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+public class MyFacesConverterTagGenerator extends AbstractConverterTagGenerator {
+
+ public MyFacesConverterTagGenerator(boolean is12, String licenseHeader, Log log) {
+ super(is12, licenseHeader, log);
+ }
+
+ protected Set createImports(ConverterBean converter) {
+ Set imports = new TreeSet();
+
+ if (is12())
+ {
+ imports.add("javax.faces.webapp.ConverterELTag");
+ imports.add("javax.faces.context.FacesContext");
+ imports.add("javax.faces.application.Application");
+ }
+ else
+ {
+ imports.add("javax.faces.webapp.ConverterTag");
+ }
+
+ imports.add("javax.servlet.jsp.JspException");
+ imports.add(converter.getConverterClass());
+
+ imports.add("javax.faces.convert.Converter");
+ if (is12())
+ {
+ imports.add("javax.el.ValueExpression");
+ }
+ else
+ {
+ imports.add("javax.faces.el.ValueBinding");
+ }
+ imports.add("org.apache.myfaces.commons.util.TagUtils");
+
+
+ addImportsFromPropertes(converter, imports);
+ return imports;
+ }
+
+
+
+
+ protected void writeSetProperty(
+ PrettyWriter out,
+ PropertyBean property)
+ {
+ String propName = property.getPropertyName();
+ String propFullClass = property.getPropertyClass();
+ String propClass = Util.getClassFromFullClass(propFullClass);
+ String propVar = "_" + Util.getVariableFromName(propName);
+
+ out.println("if (" + propVar + " != null)");
+ out.println("{");
+ out.indent();
+
+ if (is12())
+ {
+ out.println("if (!" + propVar + ".isLiteralText())");
+ out.println("{");
+ out.indent();
+ out.println("converter.setValueExpression(\"" + propName + "\", " +
+ propVar + ");");
+ out.unindent();
+ out.println("}");
+ String propType = resolveType(propFullClass);
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("converter." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+ else
+ {
+ out.println("if (TagUtils.isValueReference(" + propVar + "))");
+ out.println("{");
+ out.indent();
+ out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
+ out.println("converter.setValueBinding(\"" + propName + "\", vb);");
+ out.unindent();
+ out.println("}");
+ String propType = resolveType(propFullClass);
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("converter." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ out.unindent();
+ out.println("}");
+ }
+
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java
index 7dd4ed6..6564f8a 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/MyFacesValidatorTagGenerator.java
@@ -1,161 +1,161 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
-
-import org.apache.maven.plugin.logging.Log;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
-
-import java.util.Set;
-import java.util.TreeSet;
-
-public class MyFacesValidatorTagGenerator extends AbstractValidatorTagGenerator {
-
- public MyFacesValidatorTagGenerator(boolean is12, String licenseHeader, Log log) {
- super(is12, licenseHeader, log);
- }
-
- protected Set createImports(ValidatorBean validator) {
- Set imports = new TreeSet();
-
- if (is12())
- {
- imports.add("javax.faces.webapp.ValidatorELTag");
- imports.add("javax.faces.context.FacesContext");
- imports.add("javax.faces.application.Application");
- }
- else
- {
- imports.add("javax.faces.webapp.ValidatorTag");
- }
- imports.add("javax.servlet.jsp.JspException");
- imports.add(validator.getValidatorClass());
-
- imports.add("javax.faces.validator.Validator");
-
- if (is12())
- {
- imports.add("javax.el.ValueExpression");
- }
- else
- {
- imports.add("javax.faces.el.ValueBinding");
- }
- imports.add("org.apache.myfaces.commons.util.TagUtils");
-
-
- addImportsFromPropertes(validator, imports);
- return imports;
- }
-
- protected void writeSetProperty(
- PrettyWriter out,
- PropertyBean property)
- {
- String propName = property.getPropertyName();
- String propFullClass = property.getPropertyClass();
- String propClass = Util.getClassFromFullClass(propFullClass);
- String propVar = "_" + Util.getVariableFromName(propName);
- out.println("if (" + propVar + " != null)");
- out.println("{");
- out.indent();
- if (is12())
- {
- out.println("if (!" + propVar + ".isLiteralText())");
- out.println("{");
- out.indent();
- out.println("validator.setValueExpression(\"" + propName + "\", " +
- propVar + ");");
- out.unindent();
- out.println("}");
- String propType = resolveType(propFullClass);
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
-
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("validator." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
- else
- {
- out.println("if (TagUtils.isValueReference(" + propVar + "))");
- out.println("{");
- out.indent();
- out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
- out.println("validator.setValueBinding(\"" + propName + "\", vb);");
- out.unindent();
- out.println("}");
- String propType = resolveType(propFullClass);
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("validator." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
-
- out.unindent();
- out.println("}");
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+public class MyFacesValidatorTagGenerator extends AbstractValidatorTagGenerator {
+
+ public MyFacesValidatorTagGenerator(boolean is12, String licenseHeader, Log log) {
+ super(is12, licenseHeader, log);
+ }
+
+ protected Set createImports(ValidatorBean validator) {
+ Set imports = new TreeSet();
+
+ if (is12())
+ {
+ imports.add("javax.faces.webapp.ValidatorELTag");
+ imports.add("javax.faces.context.FacesContext");
+ imports.add("javax.faces.application.Application");
+ }
+ else
+ {
+ imports.add("javax.faces.webapp.ValidatorTag");
+ }
+ imports.add("javax.servlet.jsp.JspException");
+ imports.add(validator.getValidatorClass());
+
+ imports.add("javax.faces.validator.Validator");
+
+ if (is12())
+ {
+ imports.add("javax.el.ValueExpression");
+ }
+ else
+ {
+ imports.add("javax.faces.el.ValueBinding");
+ }
+ imports.add("org.apache.myfaces.commons.util.TagUtils");
+
+
+ addImportsFromPropertes(validator, imports);
+ return imports;
+ }
+
+ protected void writeSetProperty(
+ PrettyWriter out,
+ PropertyBean property)
+ {
+ String propName = property.getPropertyName();
+ String propFullClass = property.getPropertyClass();
+ String propClass = Util.getClassFromFullClass(propFullClass);
+ String propVar = "_" + Util.getVariableFromName(propName);
+ out.println("if (" + propVar + " != null)");
+ out.println("{");
+ out.indent();
+ if (is12())
+ {
+ out.println("if (!" + propVar + ".isLiteralText())");
+ out.println("{");
+ out.indent();
+ out.println("validator.setValueExpression(\"" + propName + "\", " +
+ propVar + ");");
+ out.unindent();
+ out.println("}");
+ String propType = resolveType(propFullClass);
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("validator." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+ else
+ {
+ out.println("if (TagUtils.isValueReference(" + propVar + "))");
+ out.println("{");
+ out.indent();
+ out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
+ out.println("validator.setValueBinding(\"" + propName + "\", vb);");
+ out.unindent();
+ out.println("}");
+ String propType = resolveType(propFullClass);
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("validator." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ out.unindent();
+ out.println("}");
+ }
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
index dfbc8b2..884b5a9 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadConverterTagGenerator.java
@@ -1,167 +1,167 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
-
-import org.apache.maven.plugin.logging.Log;
-import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ConverterBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
-
-import java.util.Set;
-import java.util.TreeSet;
-
-public class TrinidadConverterTagGenerator extends AbstractConverterTagGenerator {
-
- public TrinidadConverterTagGenerator(boolean is12, String licenseHeader, Log log) {
- super(is12, licenseHeader, log);
- }
-
- protected Set createImports(ConverterBean converter) {
- Set imports = new TreeSet();
-
- if (is12())
- {
- imports.add("javax.faces.webapp.ConverterELTag");
- imports.add("javax.faces.context.FacesContext");
- imports.add("javax.faces.application.Application");
- }
- else
- {
- imports.add("javax.faces.webapp.ConverterTag");
- }
-
- imports.add("javax.servlet.jsp.JspException");
- imports.add(converter.getConverterClass());
-
- imports.add("javax.faces.convert.Converter");
- if (is12())
- {
- imports.add("javax.el.ValueExpression");
- }
- else
- {
- imports.add("javax.faces.el.ValueBinding");
- }
- imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
-
-
- addImportsFromPropertes(converter, imports);
- return imports;
- }
-
-
-
-
- protected void writeSetProperty(
- PrettyWriter out,
- PropertyBean property)
- {
- String propName = property.getPropertyName();
- String propFullClass = property.getPropertyClass();
- String propClass = Util.getClassFromFullClass(propFullClass);
- String propVar = "_" + Util.getVariableFromName(propName);
-
- out.println("if (" + propVar + " != null)");
- out.println("{");
- out.indent();
-
- if (is12())
- {
- out.println("if (!" + propVar + ".isLiteralText())");
- out.println("{");
- out.indent();
- out.println("converter.setValueExpression(\"" + propName + "\", " +
- propVar + ");");
- out.unindent();
- out.println("}");
- String propType = resolveType(propFullClass);
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
-
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("converter." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
- else
- {
- out.println("if (TagUtils.isValueReference(" + propVar + "))");
- out.println("{");
- out.indent();
- out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
- out.println("converter.setValueBinding(\"" + propName + "\", vb);");
- out.unindent();
- out.println("}");
- String propType = resolveType(propFullClass);
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("converter." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
-
- out.unindent();
- out.println("}");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ConverterBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+public class TrinidadConverterTagGenerator extends AbstractConverterTagGenerator {
+
+ public TrinidadConverterTagGenerator(boolean is12, String licenseHeader, Log log) {
+ super(is12, licenseHeader, log);
+ }
+
+ protected Set createImports(ConverterBean converter) {
+ Set imports = new TreeSet();
+
+ if (is12())
+ {
+ imports.add("javax.faces.webapp.ConverterELTag");
+ imports.add("javax.faces.context.FacesContext");
+ imports.add("javax.faces.application.Application");
+ }
+ else
+ {
+ imports.add("javax.faces.webapp.ConverterTag");
+ }
+
+ imports.add("javax.servlet.jsp.JspException");
+ imports.add(converter.getConverterClass());
+
+ imports.add("javax.faces.convert.Converter");
+ if (is12())
+ {
+ imports.add("javax.el.ValueExpression");
+ }
+ else
+ {
+ imports.add("javax.faces.el.ValueBinding");
+ }
+ imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
+
+
+ addImportsFromPropertes(converter, imports);
+ return imports;
+ }
+
+
+
+
+ protected void writeSetProperty(
+ PrettyWriter out,
+ PropertyBean property)
+ {
+ String propName = property.getPropertyName();
+ String propFullClass = property.getPropertyClass();
+ String propClass = Util.getClassFromFullClass(propFullClass);
+ String propVar = "_" + Util.getVariableFromName(propName);
+
+ out.println("if (" + propVar + " != null)");
+ out.println("{");
+ out.indent();
+
+ if (is12())
+ {
+ out.println("if (!" + propVar + ".isLiteralText())");
+ out.println("{");
+ out.indent();
+ out.println("converter.setValueExpression(\"" + propName + "\", " +
+ propVar + ");");
+ out.unindent();
+ out.println("}");
+ String propType = resolveType(propFullClass);
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("converter." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+ else
+ {
+ out.println("if (TagUtils.isValueReference(" + propVar + "))");
+ out.println("{");
+ out.indent();
+ out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
+ out.println("converter.setValueBinding(\"" + propName + "\", vb);");
+ out.unindent();
+ out.println("}");
+ String propType = resolveType(propFullClass);
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("converter." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ out.unindent();
+ out.println("}");
+ }
+
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java
index dd30e0e..04c0d91 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadValidatorTagGenerator.java
@@ -1,177 +1,177 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
-
-import org.apache.maven.plugin.logging.Log;
-import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
-import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
-
-import java.util.Set;
-import java.util.TreeSet;
-
-public class TrinidadValidatorTagGenerator extends AbstractValidatorTagGenerator {
-
- public TrinidadValidatorTagGenerator(boolean _is12, String _licenseHeader, Log _log) {
- super(_is12, _licenseHeader, _log);
- }
-
- protected Set createImports(ValidatorBean validator) {
- Set imports = new TreeSet();
-
- if (is12())
- {
- imports.add("javax.faces.webapp.ValidatorELTag");
- imports.add("javax.faces.context.FacesContext");
- imports.add("javax.faces.application.Application");
- }
- else
- {
- imports.add("javax.faces.webapp.ValidatorTag");
- }
- imports.add("javax.servlet.jsp.JspException");
- imports.add(validator.getValidatorClass());
-
- imports.add("javax.faces.validator.Validator");
-
- if (is12())
- {
- imports.add("javax.el.ValueExpression");
- }
- else
- {
- imports.add("javax.faces.el.ValueBinding");
- }
- imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
-
-
- addImportsFromPropertes(validator, imports);
- return imports;
- }
-
- protected void writeSetProperty(
- PrettyWriter out,
- PropertyBean property)
- {
- String propName = property.getPropertyName();
- String propFullClass = property.getPropertyClass();
- String propClass = Util.getClassFromFullClass(propFullClass);
- String propVar = "_" + Util.getVariableFromName(propName);
- out.println("if (" + propVar + " != null)");
- out.println("{");
- out.indent();
- if (is12())
- {
- out.println("if (!" + propVar + ".isLiteralText())");
- out.println("{");
- out.indent();
- out.println("validator.setValueExpression(\"" + propName + "\", " +
- propVar + ");");
- out.unindent();
- out.println("}");
- String propType = null;
- if ("Date".equals (propClass))
- {
- propType = resolveDateType(propFullClass, property.getUseMaxTime());
- }
- else
- {
- propType = resolveType(propFullClass);
- }
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
-
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("validator." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
- else
- {
- out.println("if (TagUtils.isValueReference(" + propVar + "))");
- out.println("{");
- out.indent();
- out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
- out.println("validator.setValueBinding(\"" + propName + "\", vb);");
- out.unindent();
- out.println("}");
- String propType = null;
- if ("Date".equals (propClass))
- {
- propType = resolveDateType(propFullClass, property.getUseMaxTime());
- }
- else
- {
- propType = resolveType(propFullClass);
- }
- if (propType != null)
- {
- out.println("else");
- out.println("{");
- out.indent();
- if ("StringArray".equals(propType))
- {
- out.println("try");
- out.println("{");
- }
- out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
- String setMethod = Util.getPrefixedPropertyName("set", propName);
- out.println("validator." + setMethod + "(value);");
- if ("StringArray".equals(propType))
- {
- out.println("}");
- out.println("catch (ParseException pe)");
- out.println("{");
- out.indent();
- out.println("throw new JspException(");
- out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
- out.unindent();
- out.println("}");
- }
- out.unindent();
- out.println("}");
- }
- }
-
- out.unindent();
- out.println("}");
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.generator.taglib;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+public class TrinidadValidatorTagGenerator extends AbstractValidatorTagGenerator {
+
+ public TrinidadValidatorTagGenerator(boolean _is12, String _licenseHeader, Log _log) {
+ super(_is12, _licenseHeader, _log);
+ }
+
+ protected Set createImports(ValidatorBean validator) {
+ Set imports = new TreeSet();
+
+ if (is12())
+ {
+ imports.add("javax.faces.webapp.ValidatorELTag");
+ imports.add("javax.faces.context.FacesContext");
+ imports.add("javax.faces.application.Application");
+ }
+ else
+ {
+ imports.add("javax.faces.webapp.ValidatorTag");
+ }
+ imports.add("javax.servlet.jsp.JspException");
+ imports.add(validator.getValidatorClass());
+
+ imports.add("javax.faces.validator.Validator");
+
+ if (is12())
+ {
+ imports.add("javax.el.ValueExpression");
+ }
+ else
+ {
+ imports.add("javax.faces.el.ValueBinding");
+ }
+ imports.add("org.apache.myfaces.trinidadinternal.taglib.util.TagUtils");
+
+
+ addImportsFromPropertes(validator, imports);
+ return imports;
+ }
+
+ protected void writeSetProperty(
+ PrettyWriter out,
+ PropertyBean property)
+ {
+ String propName = property.getPropertyName();
+ String propFullClass = property.getPropertyClass();
+ String propClass = Util.getClassFromFullClass(propFullClass);
+ String propVar = "_" + Util.getVariableFromName(propName);
+ out.println("if (" + propVar + " != null)");
+ out.println("{");
+ out.indent();
+ if (is12())
+ {
+ out.println("if (!" + propVar + ".isLiteralText())");
+ out.println("{");
+ out.indent();
+ out.println("validator.setValueExpression(\"" + propName + "\", " +
+ propVar + ");");
+ out.unindent();
+ out.println("}");
+ String propType = null;
+ if ("Date".equals (propClass))
+ {
+ propType = resolveDateType(propFullClass, property.getUseMaxTime());
+ }
+ else
+ {
+ propType = resolveType(propFullClass);
+ }
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ".getValue(null));");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("validator." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+ else
+ {
+ out.println("if (TagUtils.isValueReference(" + propVar + "))");
+ out.println("{");
+ out.indent();
+ out.println("ValueBinding vb = TagUtils.getValueBinding(" + propVar + ");");
+ out.println("validator.setValueBinding(\"" + propName + "\", vb);");
+ out.unindent();
+ out.println("}");
+ String propType = null;
+ if ("Date".equals (propClass))
+ {
+ propType = resolveDateType(propFullClass, property.getUseMaxTime());
+ }
+ else
+ {
+ propType = resolveType(propFullClass);
+ }
+ if (propType != null)
+ {
+ out.println("else");
+ out.println("{");
+ out.indent();
+ if ("StringArray".equals(propType))
+ {
+ out.println("try");
+ out.println("{");
+ }
+ out.println(propClass + " value = TagUtils.get" + propType + "(" + propVar + ");");
+ String setMethod = Util.getPrefixedPropertyName("set", propName);
+ out.println("validator." + setMethod + "(value);");
+ if ("StringArray".equals(propType))
+ {
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("throw new JspException(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ }
+ out.unindent();
+ out.println("}");
+ }
+ }
+
+ out.unindent();
+ out.println("}");
+ }
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java
index 7ea99f9..d9cecdc 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java
@@ -1,300 +1,300 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.parse;
-
-import javax.xml.namespace.QName;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.LinkedHashMap;
-import java.lang.reflect.Modifier;
-
-public class AbstractTagBean extends ObjectBean {
- private String _description;
- private String _longDescription;
- private QName _tagName;
- private String _tagClass;
- protected Map _properties;
- private int _tagClassModifiers;
- private Map _examples;
- private int _exampleIdx = 0;
-
- public AbstractTagBean()
- {
- this(false);
- }
-
- public AbstractTagBean(boolean isComponentBean)
- {
- // Component Bean does its own thing
- // with properties. The other bean
- // types, i.e. Converters and Validators
- // use the same properties.
- if (!isComponentBean)
- {
- _properties = new LinkedHashMap();
- }
- _examples = new LinkedHashMap();
- }
-
- /**
- * Sets the description of this property.
- *
- * @param description the property description
- */
- public void setDescription(
- String description)
- {
- _description = description;
- }
-
- /**
- * Returns the description of this property.
- *
- * @return the property description
- */
- public String getDescription()
- {
- return _description;
- }
-
- /**
- * Sets the long description of this property.
- *
- * @param longDescription the long property description
- */
- public void setLongDescription(
- String longDescription)
- {
- _longDescription = longDescription;
- }
-
- /**
- * Returns the long description of this property.
- *
- * @return the long property description
- */
- public String getLongDescription()
- {
- return _longDescription;
- }
-
- /**
- * Sets the JSP tag handler class for this component.
- *
- * @param tagClass the JSP tag handler class
- */
- public void setTagClass(
- String tagClass)
- {
- _tagClass = tagClass;
- }
-
- /**
- * Returns the JSP tag handler class for this component.
- *
- * @return the JSP tag handler class
- */
- public String getTagClass()
- {
- return _tagClass;
- }
-
- /**
- * Sets the JSP tag name for this component.
- *
- * @param tagName the JSP tag name
- */
- public void setTagName(
- QName tagName)
- {
- _tagName = tagName;
- }
-
-
- /**
- * Returns the JSP tag name for this component.
- *
- * @return the JSP tag name
- */
- public QName getTagName()
- {
- return _tagName;
- }
-
- /**
- * Adds a property to this component.
- *
- * @param property the property to add
- */
- public void addProperty(
- PropertyBean property)
- {
- _properties.put(property.getPropertyName(), property);
- }
-
- /**
- * Returns the property for this property name.
- *
- * @param propertyName the property name to find
- */
- public PropertyBean findProperty(
- String propertyName)
- {
- return (PropertyBean)_properties.get(propertyName);
- }
-
- /**
- * Returns true if this component has any properties.
- *
- * @return true if this component has any properties,
- * false otherwise
- */
- public boolean hasProperties()
- {
- return !_properties.isEmpty();
- }
-
- /**
- * Returns an iterator for all properties on this component only.
- *
- * @return the property iterator
- */
- public Iterator properties()
- {
- return _properties.values().iterator();
- }
-
- /**
- * Adds a Example to this component.
- *
- * @param example the example to add
- */
- public void addExample(
- ExampleBean example)
- {
- String key = _generateExampleKey();
- example.setKey(key);
- _examples.put(key, example);
- }
-
- /**
- * Returns true if this component has any examples.
- *
- * @return true if this component has any examples,
- * false otherwise
- */
- public boolean hasExamples()
- {
- return !_examples.isEmpty();
- }
-
- /**
- * Returns the example for this example key.
- *
- * @param key the hashmap example key
- */
- public ExampleBean findExample(
- String key)
- {
- return (ExampleBean)_examples.get(key);
- }
-
- /**
- * Returns an iterator for all examples on this component only.
- *
- * @return the example iterator
- */
- public Iterator examples()
- {
- return _examples.values().iterator();
- }
-
- public void parseTagClassModifier(
- String modifier)
- {
- addTagClassModifier(_parseModifier(modifier));
- }
-
- protected int _parseModifier(
- String text)
- {
- if ("public".equals(text))
- return Modifier.PUBLIC;
- else if ("protected".equals(text))
- return Modifier.PROTECTED;
- else if ("private".equals(text))
- return Modifier.PRIVATE;
- else if ("abstract".equals(text))
- return Modifier.ABSTRACT;
- else if ("final".equals(text))
- return Modifier.FINAL;
-
- throw new IllegalArgumentException("Unrecognized modifier: " + text);
- }
-
- /**
- * Adds a Java Language class modifier to the tag class.
- *
- * @param modifier the modifier to be added
- */
- public void addTagClassModifier(
- int modifier)
- {
- _tagClassModifiers |= modifier;
- }
-
- /**
- * Returns the Java Language class modifiers for the tag class.
- * By default, these modifiers include Modifier.PUBLIC.
- *
- * @return the Java Language class modifiers for the tag class
- */
- public int getTagClassModifiers()
- {
- int modifiers = _tagClassModifiers;
-
- if (!Modifier.isPrivate(modifiers) &&
- !Modifier.isProtected(modifiers) &&
- !Modifier.isPublic(modifiers))
- {
- modifiers |= Modifier.PUBLIC;
- }
-
- return modifiers;
- }
-
- /**
- * Number of properties for this component
- * @return num of properties
- */
- public int propertiesSize()
- {
- return _properties.size();
- }
-
- /* Get a generated key to use in storing
- * this example bean in its hashmap.
- */
- private String _generateExampleKey()
- {
- String key = "Example" + Integer.toString(_exampleIdx);
- _exampleIdx++;
- return key;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.parse;
+
+import javax.xml.namespace.QName;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.LinkedHashMap;
+import java.lang.reflect.Modifier;
+
+public class AbstractTagBean extends ObjectBean {
+ private String _description;
+ private String _longDescription;
+ private QName _tagName;
+ private String _tagClass;
+ protected Map _properties;
+ private int _tagClassModifiers;
+ private Map _examples;
+ private int _exampleIdx = 0;
+
+ public AbstractTagBean()
+ {
+ this(false);
+ }
+
+ public AbstractTagBean(boolean isComponentBean)
+ {
+ // Component Bean does its own thing
+ // with properties. The other bean
+ // types, i.e. Converters and Validators
+ // use the same properties.
+ if (!isComponentBean)
+ {
+ _properties = new LinkedHashMap();
+ }
+ _examples = new LinkedHashMap();
+ }
+
+ /**
+ * Sets the description of this property.
+ *
+ * @param description the property description
+ */
+ public void setDescription(
+ String description)
+ {
+ _description = description;
+ }
+
+ /**
+ * Returns the description of this property.
+ *
+ * @return the property description
+ */
+ public String getDescription()
+ {
+ return _description;
+ }
+
+ /**
+ * Sets the long description of this property.
+ *
+ * @param longDescription the long property description
+ */
+ public void setLongDescription(
+ String longDescription)
+ {
+ _longDescription = longDescription;
+ }
+
+ /**
+ * Returns the long description of this property.
+ *
+ * @return the long property description
+ */
+ public String getLongDescription()
+ {
+ return _longDescription;
+ }
+
+ /**
+ * Sets the JSP tag handler class for this component.
+ *
+ * @param tagClass the JSP tag handler class
+ */
+ public void setTagClass(
+ String tagClass)
+ {
+ _tagClass = tagClass;
+ }
+
+ /**
+ * Returns the JSP tag handler class for this component.
+ *
+ * @return the JSP tag handler class
+ */
+ public String getTagClass()
+ {
+ return _tagClass;
+ }
+
+ /**
+ * Sets the JSP tag name for this component.
+ *
+ * @param tagName the JSP tag name
+ */
+ public void setTagName(
+ QName tagName)
+ {
+ _tagName = tagName;
+ }
+
+
+ /**
+ * Returns the JSP tag name for this component.
+ *
+ * @return the JSP tag name
+ */
+ public QName getTagName()
+ {
+ return _tagName;
+ }
+
+ /**
+ * Adds a property to this component.
+ *
+ * @param property the property to add
+ */
+ public void addProperty(
+ PropertyBean property)
+ {
+ _properties.put(property.getPropertyName(), property);
+ }
+
+ /**
+ * Returns the property for this property name.
+ *
+ * @param propertyName the property name to find
+ */
+ public PropertyBean findProperty(
+ String propertyName)
+ {
+ return (PropertyBean)_properties.get(propertyName);
+ }
+
+ /**
+ * Returns true if this component has any properties.
+ *
+ * @return true if this component has any properties,
+ * false otherwise
+ */
+ public boolean hasProperties()
+ {
+ return !_properties.isEmpty();
+ }
+
+ /**
+ * Returns an iterator for all properties on this component only.
+ *
+ * @return the property iterator
+ */
+ public Iterator properties()
+ {
+ return _properties.values().iterator();
+ }
+
+ /**
+ * Adds a Example to this component.
+ *
+ * @param example the example to add
+ */
+ public void addExample(
+ ExampleBean example)
+ {
+ String key = _generateExampleKey();
+ example.setKey(key);
+ _examples.put(key, example);
+ }
+
+ /**
+ * Returns true if this component has any examples.
+ *
+ * @return true if this component has any examples,
+ * false otherwise
+ */
+ public boolean hasExamples()
+ {
+ return !_examples.isEmpty();
+ }
+
+ /**
+ * Returns the example for this example key.
+ *
+ * @param key the hashmap example key
+ */
+ public ExampleBean findExample(
+ String key)
+ {
+ return (ExampleBean)_examples.get(key);
+ }
+
+ /**
+ * Returns an iterator for all examples on this component only.
+ *
+ * @return the example iterator
+ */
+ public Iterator examples()
+ {
+ return _examples.values().iterator();
+ }
+
+ public void parseTagClassModifier(
+ String modifier)
+ {
+ addTagClassModifier(_parseModifier(modifier));
+ }
+
+ protected int _parseModifier(
+ String text)
+ {
+ if ("public".equals(text))
+ return Modifier.PUBLIC;
+ else if ("protected".equals(text))
+ return Modifier.PROTECTED;
+ else if ("private".equals(text))
+ return Modifier.PRIVATE;
+ else if ("abstract".equals(text))
+ return Modifier.ABSTRACT;
+ else if ("final".equals(text))
+ return Modifier.FINAL;
+
+ throw new IllegalArgumentException("Unrecognized modifier: " + text);
+ }
+
+ /**
+ * Adds a Java Language class modifier to the tag class.
+ *
+ * @param modifier the modifier to be added
+ */
+ public void addTagClassModifier(
+ int modifier)
+ {
+ _tagClassModifiers |= modifier;
+ }
+
+ /**
+ * Returns the Java Language class modifiers for the tag class.
+ * By default, these modifiers include Modifier.PUBLIC.
+ *
+ * @return the Java Language class modifiers for the tag class
+ */
+ public int getTagClassModifiers()
+ {
+ int modifiers = _tagClassModifiers;
+
+ if (!Modifier.isPrivate(modifiers) &&
+ !Modifier.isProtected(modifiers) &&
+ !Modifier.isPublic(modifiers))
+ {
+ modifiers |= Modifier.PUBLIC;
+ }
+
+ return modifiers;
+ }
+
+ /**
+ * Number of properties for this component
+ * @return num of properties
+ */
+ public int propertiesSize()
+ {
+ return _properties.size();
+ }
+
+ /* Get a generated key to use in storing
+ * this example bean in its hashmap.
+ */
+ private String _generateExampleKey()
+ {
+ String key = "Example" + Integer.toString(_exampleIdx);
+ _exampleIdx++;
+ return key;
+ }
+}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ExampleBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ExampleBean.java
index 27906e5..6bcf13b 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ExampleBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ExampleBean.java
@@ -1,91 +1,91 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.faces.parse;
-
-/**
- * ExampleBean is a Java representation of the faces-config component or
- * renderer Example XML element.
- */
-public class ExampleBean extends ObjectBean
-{
- /**
- * Get source Example Description Text
- *
- * @return source Example Description Text
- */
- public String getSourceDescription()
- {
- return _sourceDescription;
- }
-
- /**
- * Set source example Description Text.
- *
- * @param sourceDescription source example Description Text.
- */
- public void setSourceDescription( String sourceDescription )
- {
- _sourceDescription = sourceDescription;
- }
-
- /**
- * Returns source Example.
- *
- * @return source Example
- */
- public String getSourceCode()
- {
- return _source;
- }
-
- /**
- * Set source example.
- *
- * @param source source example to be added to the list.
- */
- public void setSourceCode( String source )
- {
- _source = source;
- }
-
- /**
- * Returns Example hashmap key.
- *
- * @return Example hashmap key
- */
- public String getKey()
- {
- return _key;
- }
-
- /**
- * Set source example.
- *
- * @param key Set key for this example put in
- * ComponentBean _examples hashmap.
- */
- protected void setKey( String key )
- {
- _key = key;
- }
-
- private String _sourceDescription = null;
- private String _source = null;
- private String _key = null;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.parse;
+
+/**
+ * ExampleBean is a Java representation of the faces-config component or
+ * renderer Example XML element.
+ */
+public class ExampleBean extends ObjectBean
+{
+ /**
+ * Get source Example Description Text
+ *
+ * @return source Example Description Text
+ */
+ public String getSourceDescription()
+ {
+ return _sourceDescription;
+ }
+
+ /**
+ * Set source example Description Text.
+ *
+ * @param sourceDescription source example Description Text.
+ */
+ public void setSourceDescription( String sourceDescription )
+ {
+ _sourceDescription = sourceDescription;
+ }
+
+ /**
+ * Returns source Example.
+ *
+ * @return source Example
+ */
+ public String getSourceCode()
+ {
+ return _source;
+ }
+
+ /**
+ * Set source example.
+ *
+ * @param source source example to be added to the list.
+ */
+ public void setSourceCode( String source )
+ {
+ _source = source;
+ }
+
+ /**
+ * Returns Example hashmap key.
+ *
+ * @return Example hashmap key
+ */
+ public String getKey()
+ {
+ return _key;
+ }
+
+ /**
+ * Set source example.
+ *
+ * @param key Set key for this example put in
+ * ComponentBean _examples hashmap.
+ */
+ protected void setKey( String key )
+ {
+ _key = key;
+ }
+
+ private String _sourceDescription = null;
+ private String _source = null;
+ private String _key = null;
+}
diff --git a/maven-i18n-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/i18n/uixtools/LocaleDataResolver.java b/maven-i18n-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/i18n/uixtools/LocaleDataResolver.java
index abf731b..254c059 100644
--- a/maven-i18n-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/i18n/uixtools/LocaleDataResolver.java
+++ b/maven-i18n-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/i18n/uixtools/LocaleDataResolver.java
@@ -1,162 +1,162 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.i18n.uixtools;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Resolves locale specific elements like the names for month or date formats.
- * With Java 6 the needed resources are not stored anymore in reousrce files
- * but are hardcoded and can be accessed thru sun.util.resources.LocaleData.
- * <br>
- * This class uses reflection to access the resources to be compatible with
- * Java 1.4, 5 and 6.
- */
-class LocaleDataResolver {
-
- private static final String LOCAL_ELEMENTS_RESOURCE_BUNDLE_JAVA_5 = "sun.text.resources.LocaleElements";
-
- private static final String LOCAL_DATA_CLASS_JAVA_4 = "sun.text.resources.LocaleData";
-
- private static final String LOCAL_DATA_CLASS_JAVA_6 = "sun.util.resources.LocaleData";
-
- private static final String[] LOCAL_DATA_METHODS_JAVA_6 = new String[] {
- "getCalendarData", "getCollationData", "getCurrencyNames",
- "getDateFormatData", "getLocaleNames", "getNumberFormatData",
- "getTimeZoneNames" };
-
- private static final String DATE_TIME_ELEMENTS = "DateTimeElements";
-
- private static final String MINIMAL_DAYS_IN_FIRST_WEEK = "minimalDaysInFirstWeek";
-
- private static final String FIRST_DAY_OF_WEEK = "firstDayOfWeek";
-
- /**
- * Returns the element data for the given key and locale.
- *
- * @param key the key for the element
- * @param locale the locale to be used
- * @return the locale dependent element
- */
- public static Object getElementData(String key, Locale locale) {
- try {
- Class.forName(LOCAL_DATA_CLASS_JAVA_4);
- return _getElementDataJava5(key, locale);
- } catch (ClassNotFoundException e) {
- try {
- Class.forName(LOCAL_DATA_CLASS_JAVA_6);
- return _getElementDataJava6(key, locale);
- } catch (ClassNotFoundException e1) {
- throw new IllegalStateException(
- "could not access the java resource bundles");
- }
- }
- }
-
- /**
- * Returns the element data for the given key and locale using
- * the java 1.4/5 mechanism to access the resources.
- *
- * @param key the key for the element
- * @param locale the locale to be used
- * @return the locale dependent element
- */
- private static Object _getElementDataJava5(String key, Locale locale) {
- ResourceBundle elementsData = ResourceBundle.getBundle(
- LOCAL_ELEMENTS_RESOURCE_BUNDLE_JAVA_5, locale);
- return elementsData.getObject(key);
- }
-
- /**
- * Returns the element data for the given key and locale using
- * the java 6 mechanism to access the resources.
- *
- * @param key the key for the element
- * @param locale the locale to be used
- * @return the locale dependent element
- */
- private static Object _getElementDataJava6(String key, Locale locale) {
-
- if (DATE_TIME_ELEMENTS.equals(key)) {
- return new Object[] {
- _getElementDataJava6(FIRST_DAY_OF_WEEK, locale),
- _getElementDataJava6(MINIMAL_DAYS_IN_FIRST_WEEK, locale) };
- } else {
- for (int i = 0; i < LOCAL_DATA_METHODS_JAVA_6.length; i++) {
- ResourceBundle bundle = _getLocaleDataResourceBundleJava6(
- LOCAL_DATA_METHODS_JAVA_6[i], locale);
- if (_containsKey(bundle, key)) {
- return bundle.getObject(key);
- }
- }
- }
-
- throw new MissingResourceException(
- "no element found in the java resource bundles for the given key",
- null, key);
- }
-
- /**
- * @param bundle
- * @param key
- * @return true if the given key exists in the given bundle
- */
- private static boolean _containsKey(ResourceBundle bundle, String key) {
- for (Enumeration e = bundle.getKeys(); e.hasMoreElements();) {
- if (((String) e.nextElement()).equals(key))
- return true;
- }
- return false;
- }
-
- /**
- * Gives access to the java 6 implementation using reflection.
- *
- * @param name
- * @param locale
- * @return the resource bundle for the given method name and locale
- */
- private static ResourceBundle _getLocaleDataResourceBundleJava6(
- String name, Locale locale) {
- try {
- Class localDataClass = Class.forName(LOCAL_DATA_CLASS_JAVA_6);
- Method method = localDataClass.getMethod(name,
- new Class[] { Locale.class });
- Object bundle = method.invoke(null, new Object[] { locale });
- return (ResourceBundle) bundle;
- } catch (ClassNotFoundException e) {
- throw new IllegalStateException();
- } catch (SecurityException e) {
- throw new IllegalStateException();
- } catch (NoSuchMethodException e) {
- throw new IllegalStateException();
- } catch (IllegalArgumentException e) {
- throw new IllegalStateException();
- } catch (IllegalAccessException e) {
- throw new IllegalStateException();
- } catch (InvocationTargetException e) {
- throw new IllegalStateException();
- }
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.i18n.uixtools;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * Resolves locale specific elements like the names for month or date formats.
+ * With Java 6 the needed resources are not stored anymore in reousrce files
+ * but are hardcoded and can be accessed thru sun.util.resources.LocaleData.
+ * <br>
+ * This class uses reflection to access the resources to be compatible with
+ * Java 1.4, 5 and 6.
+ */
+class LocaleDataResolver {
+
+ private static final String LOCAL_ELEMENTS_RESOURCE_BUNDLE_JAVA_5 = "sun.text.resources.LocaleElements";
+
+ private static final String LOCAL_DATA_CLASS_JAVA_4 = "sun.text.resources.LocaleData";
+
+ private static final String LOCAL_DATA_CLASS_JAVA_6 = "sun.util.resources.LocaleData";
+
+ private static final String[] LOCAL_DATA_METHODS_JAVA_6 = new String[] {
+ "getCalendarData", "getCollationData", "getCurrencyNames",
+ "getDateFormatData", "getLocaleNames", "getNumberFormatData",
+ "getTimeZoneNames" };
+
+ private static final String DATE_TIME_ELEMENTS = "DateTimeElements";
+
+ private static final String MINIMAL_DAYS_IN_FIRST_WEEK = "minimalDaysInFirstWeek";
+
+ private static final String FIRST_DAY_OF_WEEK = "firstDayOfWeek";
+
+ /**
+ * Returns the element data for the given key and locale.
+ *
+ * @param key the key for the element
+ * @param locale the locale to be used
+ * @return the locale dependent element
+ */
+ public static Object getElementData(String key, Locale locale) {
+ try {
+ Class.forName(LOCAL_DATA_CLASS_JAVA_4);
+ return _getElementDataJava5(key, locale);
+ } catch (ClassNotFoundException e) {
+ try {
+ Class.forName(LOCAL_DATA_CLASS_JAVA_6);
+ return _getElementDataJava6(key, locale);
+ } catch (ClassNotFoundException e1) {
+ throw new IllegalStateException(
+ "could not access the java resource bundles");
+ }
+ }
+ }
+
+ /**
+ * Returns the element data for the given key and locale using
+ * the java 1.4/5 mechanism to access the resources.
+ *
+ * @param key the key for the element
+ * @param locale the locale to be used
+ * @return the locale dependent element
+ */
+ private static Object _getElementDataJava5(String key, Locale locale) {
+ ResourceBundle elementsData = ResourceBundle.getBundle(
+ LOCAL_ELEMENTS_RESOURCE_BUNDLE_JAVA_5, locale);
+ return elementsData.getObject(key);
+ }
+
+ /**
+ * Returns the element data for the given key and locale using
+ * the java 6 mechanism to access the resources.
+ *
+ * @param key the key for the element
+ * @param locale the locale to be used
+ * @return the locale dependent element
+ */
+ private static Object _getElementDataJava6(String key, Locale locale) {
+
+ if (DATE_TIME_ELEMENTS.equals(key)) {
+ return new Object[] {
+ _getElementDataJava6(FIRST_DAY_OF_WEEK, locale),
+ _getElementDataJava6(MINIMAL_DAYS_IN_FIRST_WEEK, locale) };
+ } else {
+ for (int i = 0; i < LOCAL_DATA_METHODS_JAVA_6.length; i++) {
+ ResourceBundle bundle = _getLocaleDataResourceBundleJava6(
+ LOCAL_DATA_METHODS_JAVA_6[i], locale);
+ if (_containsKey(bundle, key)) {
+ return bundle.getObject(key);
+ }
+ }
+ }
+
+ throw new MissingResourceException(
+ "no element found in the java resource bundles for the given key",
+ null, key);
+ }
+
+ /**
+ * @param bundle
+ * @param key
+ * @return true if the given key exists in the given bundle
+ */
+ private static boolean _containsKey(ResourceBundle bundle, String key) {
+ for (Enumeration e = bundle.getKeys(); e.hasMoreElements();) {
+ if (((String) e.nextElement()).equals(key))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Gives access to the java 6 implementation using reflection.
+ *
+ * @param name
+ * @param locale
+ * @return the resource bundle for the given method name and locale
+ */
+ private static ResourceBundle _getLocaleDataResourceBundleJava6(
+ String name, Locale locale) {
+ try {
+ Class localDataClass = Class.forName(LOCAL_DATA_CLASS_JAVA_6);
+ Method method = localDataClass.getMethod(name,
+ new Class[] { Locale.class });
+ Object bundle = method.invoke(null, new Object[] { locale });
+ return (ResourceBundle) bundle;
+ } catch (ClassNotFoundException e) {
+ throw new IllegalStateException();
+ } catch (SecurityException e) {
+ throw new IllegalStateException();
+ } catch (NoSuchMethodException e) {
+ throw new IllegalStateException();
+ } catch (IllegalArgumentException e) {
+ throw new IllegalStateException();
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException();
+ } catch (InvocationTargetException e) {
+ throw new IllegalStateException();
+ }
+ }
}
\ No newline at end of file
diff --git a/maven-jdev-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/jdeveloper/TldContentHandler.java b/maven-jdev-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/jdeveloper/TldContentHandler.java
index afa1a71..796d342 100644
--- a/maven-jdev-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/jdeveloper/TldContentHandler.java
+++ b/maven-jdev-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/jdeveloper/TldContentHandler.java
@@ -1,233 +1,233 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.apache.myfaces.trinidadbuild.plugin.jdeveloper;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-
-import org.w3c.dom.Node;
-
-import org.w3c.dom.NodeList;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-public class TldContentHandler
-{
- /**
- * Content Handler.
- */
- public TldContentHandler()
- {
- }
-
- /**
- * Parse the .tld file to get the information
- * needed for the .jpr
- */
- public void parseTld(File file)
- throws SAXException,
- IOException,
- ParserConfigurationException
- {
- // Create a builder factory
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setValidating(false);
-
- // Create the Builder and parse the file
- DocumentBuilder docBuilder = factory.newDocumentBuilder();
-
- // Set Entity Resolver to resolve external entities, i.e.
- // the "http://...." in the <!DOCTYPE tag
- EntityResolver entityResolver = new PluginEntityResolver();
- docBuilder.setEntityResolver(entityResolver);
- Document document = docBuilder.parse(file);
-
- _processTldNodes(document);
- }
-
- /*=========================================================================
- * Gettors and settors
- * ======================================================================*/
-
- public void setVersion(String version)
- {
- _version = version;
- }
-
- public void setName(String name)
- {
- _name = name;
- }
-
- public void setPrefix(String prefix)
- {
- _prefix = prefix;
- }
-
- public void setURI(String uri)
- {
- _uri = uri;
- }
-
- public void setJspVersion(String jspVersion)
- {
- _jspVersion = jspVersion;
- }
-
- public String getVersion()
- {
- return _version == null? "" : _version;
- }
-
- public String getName()
- {
- return _name == null? "" : _name;
- }
-
- public String getPrefix()
- {
- return _prefix == null? "" : _prefix;
- }
-
- public String getURI()
- {
- return _uri == null? "" : _uri;
- }
-
- public String getJspVersion()
- {
- return _jspVersion == null? "" : _jspVersion;
- }
-
-
- /**
- * Find all the TLD nodes we want, get each node's value
- * and set the value on the proper class property.
- *
- * @param document - DOM Document from the TLD file
- */
- private void _processTldNodes(Document document)
- {
- Node node = null;
-
- // Get the Nodes first node. We can be specific here
- // because we know we want the first node.
- NodeList nodeList = document.getElementsByTagName(_TLIB_VERSION);
- if (nodeList != null && nodeList.getLength() != 0)
- {
- node = nodeList.item(0);
- setVersion(node.getFirstChild().getNodeValue());
- }
-
- nodeList = document.getElementsByTagName(_JSP_VERSION);
- if (nodeList != null && nodeList.getLength() != 0)
- {
- node = nodeList.item(0);
- setJspVersion(node.getFirstChild().getNodeValue());
- }
-
- // Must go before _DISPLAY_NAME
- nodeList = document.getElementsByTagName(_SHORT_NAME);
- if (nodeList != null && nodeList.getLength() != 0)
- {
- node = nodeList.item(0);
- setPrefix(node.getFirstChild().getNodeValue());
- }
-
- // Must go after _SHORT_NAME
- nodeList = document.getElementsByTagName(_DISPLAY_NAME);
- if (nodeList != null && nodeList.getLength() != 0)
- {
- node = nodeList.item(0);
- setName(node.getFirstChild().getNodeValue());
- }
- else
- {
- setName(getPrefix());
- }
-
- nodeList = document.getElementsByTagName(_URI);
- if (nodeList != null && nodeList.getLength() != 0)
- {
- node = nodeList.item(0);
- setURI(node.getFirstChild().getNodeValue());
- }
- }
-
- //========================================================================
- // Private variables
- //========================================================================
-
- private String _version = null; // tlib-version
- private String _name = null; // display-name
- private String _prefix = null; // short-name
- private String _jspVersion = null; // jsp-version
- private String _uri = null; // uri
-
- private final static String _TLIB_VERSION = "tlib-version"; //version NOTRANS
- private final static String _DISPLAY_NAME = "display-name"; //name NOTRANS
- private final static String _SHORT_NAME = "short-name"; //prefix NOTRANS
- private final static String _JSP_VERSION = "jsp-version"; //NOTRANS
- private final static String _URI = "uri";
-
-
- /**
- * Gary Kind 01/22/2008. This class is used solely to get around a
- * java.net.NoRouteToHostException that occurs in the tag libs
- * <!DOCTYPE... tag, which is:
- *
- * <!DOCTYPE taglib
- * PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- * "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
- *
- * The http URL causes this exception for some unknown reason. I have
- * searched high and low on the web for a real solution and finally found
- * this workaround at
- * http://forum.java.sun.com/thread.jspa?threadID=284209&forumID=34
- * Apparently a LOT of developers are seeing similar problems and they too
- * are not able to find a solution. This workaround works perfectly and all
- * is well.
- */
- private class PluginEntityResolver
- implements EntityResolver
- {
- public InputSource resolveEntity(String publicId, String systemId)
- {
- if ("-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN".equals(publicId))
- {
- String xmlStr = "<?xml version='1.0' encoding='UTF-8'?>";
- byte[] buf = xmlStr.getBytes();
- ByteArrayInputStream bais = new ByteArrayInputStream(buf);
- return new InputSource(bais);
- }
- else
- return null;
- }
- }
-
-} // endclass TldContentHandler
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.jdeveloper;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+
+import org.w3c.dom.Node;
+
+import org.w3c.dom.NodeList;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class TldContentHandler
+{
+ /**
+ * Content Handler.
+ */
+ public TldContentHandler()
+ {
+ }
+
+ /**
+ * Parse the .tld file to get the information
+ * needed for the .jpr
+ */
+ public void parseTld(File file)
+ throws SAXException,
+ IOException,
+ ParserConfigurationException
+ {
+ // Create a builder factory
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(false);
+
+ // Create the Builder and parse the file
+ DocumentBuilder docBuilder = factory.newDocumentBuilder();
+
+ // Set Entity Resolver to resolve external entities, i.e.
+ // the "http://...." in the <!DOCTYPE tag
+ EntityResolver entityResolver = new PluginEntityResolver();
+ docBuilder.setEntityResolver(entityResolver);
+ Document document = docBuilder.parse(file);
+
+ _processTldNodes(document);
+ }
+
+ /*=========================================================================
+ * Gettors and settors
+ * ======================================================================*/
+
+ public void setVersion(String version)
+ {
+ _version = version;
+ }
+
+ public void setName(String name)
+ {
+ _name = name;
+ }
+
+ public void setPrefix(String prefix)
+ {
+ _prefix = prefix;
+ }
+
+ public void setURI(String uri)
+ {
+ _uri = uri;
+ }
+
+ public void setJspVersion(String jspVersion)
+ {
+ _jspVersion = jspVersion;
+ }
+
+ public String getVersion()
+ {
+ return _version == null? "" : _version;
+ }
+
+ public String getName()
+ {
+ return _name == null? "" : _name;
+ }
+
+ public String getPrefix()
+ {
+ return _prefix == null? "" : _prefix;
+ }
+
+ public String getURI()
+ {
+ return _uri == null? "" : _uri;
+ }
+
+ public String getJspVersion()
+ {
+ return _jspVersion == null? "" : _jspVersion;
+ }
+
+
+ /**
+ * Find all the TLD nodes we want, get each node's value
+ * and set the value on the proper class property.
+ *
+ * @param document - DOM Document from the TLD file
+ */
+ private void _processTldNodes(Document document)
+ {
+ Node node = null;
+
+ // Get the Nodes first node. We can be specific here
+ // because we know we want the first node.
+ NodeList nodeList = document.getElementsByTagName(_TLIB_VERSION);
+ if (nodeList != null && nodeList.getLength() != 0)
+ {
+ node = nodeList.item(0);
+ setVersion(node.getFirstChild().getNodeValue());
+ }
+
+ nodeList = document.getElementsByTagName(_JSP_VERSION);
+ if (nodeList != null && nodeList.getLength() != 0)
+ {
+ node = nodeList.item(0);
+ setJspVersion(node.getFirstChild().getNodeValue());
+ }
+
+ // Must go before _DISPLAY_NAME
+ nodeList = document.getElementsByTagName(_SHORT_NAME);
+ if (nodeList != null && nodeList.getLength() != 0)
+ {
+ node = nodeList.item(0);
+ setPrefix(node.getFirstChild().getNodeValue());
+ }
+
+ // Must go after _SHORT_NAME
+ nodeList = document.getElementsByTagName(_DISPLAY_NAME);
+ if (nodeList != null && nodeList.getLength() != 0)
+ {
+ node = nodeList.item(0);
+ setName(node.getFirstChild().getNodeValue());
+ }
+ else
+ {
+ setName(getPrefix());
+ }
+
+ nodeList = document.getElementsByTagName(_URI);
+ if (nodeList != null && nodeList.getLength() != 0)
+ {
+ node = nodeList.item(0);
+ setURI(node.getFirstChild().getNodeValue());
+ }
+ }
+
+ //========================================================================
+ // Private variables
+ //========================================================================
+
+ private String _version = null; // tlib-version
+ private String _name = null; // display-name
+ private String _prefix = null; // short-name
+ private String _jspVersion = null; // jsp-version
+ private String _uri = null; // uri
+
+ private final static String _TLIB_VERSION = "tlib-version"; //version NOTRANS
+ private final static String _DISPLAY_NAME = "display-name"; //name NOTRANS
+ private final static String _SHORT_NAME = "short-name"; //prefix NOTRANS
+ private final static String _JSP_VERSION = "jsp-version"; //NOTRANS
+ private final static String _URI = "uri";
+
+
+ /**
+ * Gary Kind 01/22/2008. This class is used solely to get around a
+ * java.net.NoRouteToHostException that occurs in the tag libs
+ * <!DOCTYPE... tag, which is:
+ *
+ * <!DOCTYPE taglib
+ * PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ * "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+ *
+ * The http URL causes this exception for some unknown reason. I have
+ * searched high and low on the web for a real solution and finally found
+ * this workaround at
+ * http://forum.java.sun.com/thread.jspa?threadID=284209&forumID=34
+ * Apparently a LOT of developers are seeing similar problems and they too
+ * are not able to find a solution. This workaround works perfectly and all
+ * is well.
+ */
+ private class PluginEntityResolver
+ implements EntityResolver
+ {
+ public InputSource resolveEntity(String publicId, String systemId)
+ {
+ if ("-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN".equals(publicId))
+ {
+ String xmlStr = "<?xml version='1.0' encoding='UTF-8'?>";
+ byte[] buf = xmlStr.getBytes();
+ ByteArrayInputStream bais = new ByteArrayInputStream(buf);
+ return new InputSource(bais);
+ }
+ else
+ return null;
+ }
+ }
+
+} // endclass TldContentHandler
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 03/17: update the rest of the poms as well
to 1.2.10.1
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 0285119bccaed41fea530043f6b14dd53b71079e
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Mar 3 23:57:07 2009 +0000
update the rest of the poms as well to 1.2.10.1
---
maven-faces-plugin/pom.xml | 4 ++--
maven-i18n-plugin/pom.xml | 4 ++--
maven-javacc-plugin/pom.xml | 4 ++--
maven-javascript-plugin/pom.xml | 4 ++--
maven-jdev-plugin/pom.xml | 4 ++--
maven-tagdoc-plugin/pom.xml | 4 ++--
maven-xrts-plugin/pom.xml | 4 ++--
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/maven-faces-plugin/pom.xml b/maven-faces-plugin/pom.xml
index 80358f7..036bbf7 100644
--- a/maven-faces-plugin/pom.xml
+++ b/maven-faces-plugin/pom.xml
@@ -15,7 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-i18n-plugin/pom.xml b/maven-i18n-plugin/pom.xml
index 715950c..da41ca1 100644
--- a/maven-i18n-plugin/pom.xml
+++ b/maven-i18n-plugin/pom.xml
@@ -15,7 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-javacc-plugin/pom.xml b/maven-javacc-plugin/pom.xml
index a3ac821..e059c74 100644
--- a/maven-javacc-plugin/pom.xml
+++ b/maven-javacc-plugin/pom.xml
@@ -15,7 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-javascript-plugin/pom.xml b/maven-javascript-plugin/pom.xml
index e83d3f1..2ca5e40 100644
--- a/maven-javascript-plugin/pom.xml
+++ b/maven-javascript-plugin/pom.xml
@@ -15,7 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-jdev-plugin/pom.xml b/maven-jdev-plugin/pom.xml
index 693035c..3a56858 100644
--- a/maven-jdev-plugin/pom.xml
+++ b/maven-jdev-plugin/pom.xml
@@ -15,7 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-tagdoc-plugin/pom.xml b/maven-tagdoc-plugin/pom.xml
index c762c2f..43669fa 100644
--- a/maven-tagdoc-plugin/pom.xml
+++ b/maven-tagdoc-plugin/pom.xml
@@ -15,7 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
diff --git a/maven-xrts-plugin/pom.xml b/maven-xrts-plugin/pom.xml
index f27abf8..2d1956e 100644
--- a/maven-xrts-plugin/pom.xml
+++ b/maven-xrts-plugin/pom.xml
@@ -15,7 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
+
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
</parent>
<groupId>org.apache.myfaces.trinidadbuild</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 07/17: TRINIDAD-1461 - Build framework for
jsr-276 metadata
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 24745d534793bfe656c2e76317b3311271256297
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Mon May 4 06:11:35 2009 +0000
TRINIDAD-1461 - Build framework for jsr-276 metadata
Thanks to Bill Baggett for the patch
---
.../plugin/faces/GenerateJspTaglibsMojo.java | 3 +-
.../plugin/faces/parse/FacesConfigParser.java | 4 +
.../plugin/faces/parse/PropertyBean.java | 19 +++
.../plugin/faces/resources/transform12.xsl | 137 ++++++++++++++++++++-
4 files changed, 159 insertions(+), 4 deletions(-)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
index 3fbecae..3bd4825 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
@@ -610,7 +610,8 @@ public class GenerateJspTaglibsMojo extends AbstractFacesMojo
}
stream.writeEndElement();
}
- else if (!property.isLiteralOnly() ||
+ else if ((!property.isLiteralOnly() &&
+ (!(property.getValueExpression() != null && property.getValueExpression().equals("PROHIBITED")))) ||
// "binding" is always a deferred-value
"binding".equals(propertyName))
{
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index 0de5e3f..404a484 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -252,6 +252,10 @@ public class FacesConfigParser
digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/deprecated");
digester.addCallMethod("faces-config/component/property/property-extension/property-metadata/no-op", "makeNoOp");
+ // jsr-276 metadata rules
+ digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee/faces/design-time-metadata");
+ digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/required");
+ digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/value-expression", "valueExpression");
// XInclude rules
digester.setRuleNamespaceURI(XIncludeFilter.XINCLUDE_NAMESPACE);
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java
index d641ea1..1f1a36d 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java
@@ -500,6 +500,24 @@ public class PropertyBean extends AttributeBean
this._noOp = true;
}
+ /**
+ * Sets the property valueExpression
+ * @param valueExpression
+ */
+ public void setValueExpression(String valueExpression)
+ {
+ this._valueExpression = valueExpression;
+ }
+
+ /**
+ * Value is provided through the valueExpression property metadata.
+ * @return valueExpression of the property
+ */
+ public String getValueExpression()
+ {
+ return _valueExpression;
+ }
+
private String _aliasOf;
private String _jspPropertyName;
private String _fieldPropertyName;
@@ -518,6 +536,7 @@ public class PropertyBean extends AttributeBean
private String[] _unsupportedRenderKits = _EMPTY_ARRAY;
private String _deprecated;
private boolean _noOp = false;
+ private String _valueExpression;
static private String[] _EMPTY_ARRAY = new String[0];
diff --git a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
index 06152ed..6ca5f27 100644
--- a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
+++ b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
@@ -24,8 +24,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
- exclude-result-prefixes="xsl xs javaee mfp"
- version="1.0" >
+ xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"
+ xmlns:exsl="http://exslt.org/common"
+ exclude-result-prefixes="xsl xs javaee mfp fmd"
+ version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:param name="packageContains" />
@@ -47,9 +49,24 @@
<!-- switch off default text processing -->
<xsl:template match="//text()" />
+ <!-- these are used for inserting a namespace declaration in xslt 1.0 -->
+ <xsl:variable name="fmd">
+ <xsl:element name="fmd:xxx" namespace="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"/>
+ </xsl:variable>
+ <xsl:variable name="mfp">
+ <xsl:element name="mfp:xxx" namespace="http://myfaces.apache.org/maven-faces-plugin"/>
+ </xsl:variable>
+ <xsl:variable name="mafp">
+ <xsl:element name="mafp:xxx" namespace="http://xmlns.oracle.com/maven-adf-faces-plugin"/>
+ </xsl:variable>
+
<xsl:template match="/javaee:faces-config" >
<xsl:element name="faces-config"
namespace="http://java.sun.com/xml/ns/javaee" >
+ <!-- Add namespace declarations at root element, so they don't show up at lower elements when we change namespaces -->
+ <xsl:copy-of select="exsl:node-set($fmd)//namespace::*"/>
+ <xsl:copy-of select="exsl:node-set($mfp)//namespace::*"/>
+ <xsl:copy-of select="exsl:node-set($mafp)//namespace::*"/>
<xsl:attribute name="xsi:schemaLocation">http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd</xsl:attribute>
<xsl:attribute name="version">1.2</xsl:attribute>
<xsl:apply-templates select="javaee:application" />
@@ -78,6 +95,7 @@
</xsl:for-each>
<xsl:apply-templates select="javaee:lifecycle[contains(javaee:phase-listener, $packageContains)]" />
<xsl:apply-templates select="javaee:validator[contains(javaee:validator-class, $validatorPackageContains)]" />
+ <xsl:apply-templates select="javaee:faces-config-extension" />
</xsl:element>
</xsl:template>
@@ -362,12 +380,14 @@
<xsl:element name="facet-extension">
<!-- Check for possible children of the metadata -->
<xsl:if test="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee']">
+ <xsl:apply-templates select="fmd:facet-metadata"/>
<xsl:element name="facet-metadata">
<!-- Select metadata children -->
<xsl:apply-templates select="mfp:facet-metadata/*[
namespace-uri() != 'http://java.sun.com/xml/ns/javaee']" />
<!-- Add non-metadata children under the metadata -->
<xsl:apply-templates select="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
+ and namespace-uri() != 'http://java.sun.com/xml/ns/javaee/faces/design-time-metadata'
and (
namespace-uri() != 'http://myfaces.apache.org/maven-faces-plugin'
or name() != 'mfp:facet-metadata'
@@ -460,12 +480,14 @@
<xsl:element name="property-extension">
<!-- Check for possible children of the metadata -->
<xsl:if test="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee']">
+ <xsl:apply-templates select="fmd:property-metadata"/>
<xsl:element name="property-metadata">
<!-- Select metadata children -->
<xsl:apply-templates select="mfp:property-metadata/*[
namespace-uri() != 'http://java.sun.com/xml/ns/javaee']" />
<!-- Add non-metadata children under the metadata -->
<xsl:apply-templates select="*[namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
+ and namespace-uri() != 'http://java.sun.com/xml/ns/javaee/faces/design-time-metadata'
and (
namespace-uri() != 'http://myfaces.apache.org/maven-faces-plugin'
or name() != 'mfp:property-metadata'
@@ -876,7 +898,8 @@
See JIRA issues ADFFACES-358, ADFFACES-361 and ADFFACES-472 -->
<xsl:template match="javaee:property-extension/*[
namespace-uri() != 'http://java.sun.com/xml/ns/javaee'
- and namespace-uri() !='http://myfaces.apache.org/maven-faces-plugin']">
+ and namespace-uri() !='http://myfaces.apache.org/maven-faces-plugin'
+ and namespace-uri() !='http://java.sun.com/xml/ns/javaee/faces/design-time-metadata']">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:value-of select="text()"/>
@@ -901,6 +924,114 @@
</xsl:element>
</xsl:template>
+ <!-- Rule for the jsr-276 (top level) component metadata, just copy the whole thing -->
+ <xsl:template match="//fmd:component-metadata">
+ <xsl:element name="fmd:component-metadata">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Rule for the jsr-276 (top level) property metadata, just copy the whole thing -->
+ <xsl:template match="//fmd:property-metadata">
+ <xsl:element name="fmd:property-metadata">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Rule for the jsr-276 (top level) facet metadata, just copy the whole thing -->
+ <xsl:template match="//fmd:facet-metadata">
+ <xsl:element name="fmd:facet-metadata">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//javaee:faces-config-extension">
+ <xsl:apply-templates select="fmd:global-metadata"/>
+ </xsl:template>
+
+ <!-- Rule for the jsr-276 (top level) global metadata extension -->
+ <xsl:template match="//fmd:global-metadata">
+ <xsl:element name="faces-config-extension">
+ <xsl:element name="fmd:global-metadata">
+ <xsl:apply-templates select="fmd:contract-definitions"/>
+ <xsl:apply-templates select="fmd:component-category-definitions"/>
+ <xsl:apply-templates select="fmd:property-category-definitions"/>
+ <xsl:apply-templates select="fmd:faces-taglib-definitions"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:contract-definitions">
+ <xsl:element name="fmd:contract-definitions">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:component-category-definitions">
+ <xsl:element name="fmd:component-category-definitions">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:property-category-definitions">
+ <xsl:element name="fmd:property-category-definitions">
+ <xsl:copy-of select="*"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:faces-taglib-definitions">
+ <xsl:element name="fmd:faces-taglib-definitions">
+ <xsl:apply-templates select="fmd:faces-taglib"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//fmd:faces-taglib">
+ <xsl:element name="fmd:faces-taglib">
+ <xsl:copy-of select="*"/>
+ <xsl:variable name="tagPrefix" select="fmd:short-name/text()"/>
+ <xsl:apply-templates select="*"/>
+ <xsl:for-each select="//javaee:validator">
+ <xsl:if test="starts-with(javaee:validator-extension/mfp:tag-name/text(), $tagPrefix)" >
+ <xsl:element name="fmd:tag">
+ <xsl:element name="fmd:name">
+ <xsl:value-of select="substring-after(javaee:validator-extension/mfp:tag-name/text(), ':')"/>
+ </xsl:element>
+ <xsl:element name="fmd:validator-id">
+ <xsl:value-of select="javaee:validator-id/text()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="//javaee:converter" >
+ <xsl:if test="starts-with(javaee:converter-extension/mfp:tag-name/text(), $tagPrefix)" >
+ <xsl:element name="fmd:tag">
+ <xsl:element name="fmd:name">
+ <xsl:value-of select="substring-after(javaee:converter-extension/mfp:tag-name/text(), ':')"/>
+ </xsl:element>
+ <xsl:element name="fmd:converter-id">
+ <xsl:value-of select="javaee:converter-id/text()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="//javaee:component" >
+ <xsl:if test="starts-with(javaee:component-extension/mfp:tag-name/text(), $tagPrefix)" >
+ <xsl:element name="fmd:tag">
+ <xsl:element name="fmd:name">
+ <xsl:value-of select="substring-after(javaee:component-extension/mfp:tag-name/text(), ':')"/>
+ </xsl:element>
+ <xsl:element name="fmd:component-type">
+ <xsl:value-of select="javaee:component-type/text()"/>
+ </xsl:element>
+ <xsl:element name="fmd:renderer-type">
+ <xsl:value-of select="javaee:component-extension/mfp:renderer-type/text()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+
<!-- Blacklisted mfp: that should not be copied over into the faces-config.xml: -->
<xsl:template match="//mfp:alternate-class" />
<xsl:template match="//mfp:author" />
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 08/17: TRINIDAD-1466 - Support xinclude'd
property metadata
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 780369fe027895d52da2878165e023a0efa97d69
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Tue May 5 06:39:32 2009 +0000
TRINIDAD-1466 - Support xinclude'd property metadata
Thanks for the patch, Andy Schwartz
---
.../plugin/faces/parse/FacesConfigParser.java | 73 ++++++++++++++++------
1 file changed, 55 insertions(+), 18 deletions(-)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index 404a484..9e05b61 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -109,13 +109,7 @@ public class FacesConfigParser
// faces-config/component/property
digester.addObjectCreate("faces-config/component/property", PropertyBean.class);
- digester.addBeanPropertySetter("faces-config/component/property/property-name",
- "propertyName");
- digester.addBeanPropertySetter("faces-config/component/property/property-class",
- "propertyClass");
- digester.addBeanPropertySetter("faces-config/component/property/description");
- digester.addBeanPropertySetter("faces-config/component/property/default-value",
- "defaultValue");
+ addComponentPropertyDigesterRules(digester);
digester.addSetNext("faces-config/component/property", "addProperty",
PropertyBean.class.getName());
@@ -205,6 +199,37 @@ public class FacesConfigParser
digester.addSetNext("faces-config/component/component-extension/event", "addEvent",
EventRefBean.class.getName());
+ // jsr-276 metadata rules
+ digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee/faces/design-time-metadata");
+ digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/required");
+ digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/value-expression", "valueExpression");
+
+ // XInclude rules
+ digester.setRuleNamespaceURI(XIncludeFilter.XINCLUDE_NAMESPACE);
+ digester.addFactoryCreate("faces-config/component/include",
+ ComponentIncludeFactory.class);
+ digester.addFactoryCreate("faces-config/component/property/include",
+ ComponentPropertyIncludeFactory.class);
+ }
+
+ // Add component property-related digster rules
+ protected static void addComponentPropertyDigesterRules(Digester digester)
+ {
+ String oldNamespace = digester.getRuleNamespaceURI();
+
+ digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee");
+
+ digester.addBeanPropertySetter("faces-config/component/property/property-name",
+ "propertyName");
+ digester.addBeanPropertySetter("faces-config/component/property/property-class",
+ "propertyClass");
+ digester.addBeanPropertySetter("faces-config/component/property/description");
+ digester.addBeanPropertySetter("faces-config/component/property/default-value",
+ "defaultValue");
+
+ // Maven Faces Plugin
+ digester.setRuleNamespaceURI("http://myfaces.apache.org/maven-faces-plugin");
+
// faces-config/component/property/property-extension
digester.addBeanPropertySetter("faces-config/component/property/property-extension/state-holder",
"stateHolder");
@@ -252,15 +277,7 @@ public class FacesConfigParser
digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/deprecated");
digester.addCallMethod("faces-config/component/property/property-extension/property-metadata/no-op", "makeNoOp");
- // jsr-276 metadata rules
- digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee/faces/design-time-metadata");
- digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/required");
- digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/value-expression", "valueExpression");
-
- // XInclude rules
- digester.setRuleNamespaceURI(XIncludeFilter.XINCLUDE_NAMESPACE);
- digester.addFactoryCreate("faces-config/component/include",
- ComponentIncludeFactory.class);
+ digester.setRuleNamespaceURI(oldNamespace);
}
protected static void addConverterDigesterRules(Digester digester)
@@ -456,7 +473,8 @@ public class FacesConfigParser
return digester;
}
- static public class ComponentIncludeFactory extends AbstractObjectCreationFactory
+ // Base class for include factories
+ abstract static public class AbstractIncludeFactory extends AbstractObjectCreationFactory
{
public Object createObject(
Attributes attributes) throws Exception
@@ -469,7 +487,7 @@ public class FacesConfigParser
URL included = new URL(master, href);
Digester includedDigester = createEmptyDigester();
- addComponentDigesterRules(includedDigester, false);
+ addDigesterRules(includedDigester);
includedDigester.push(included);
includedDigester.push(digester.peek());
@@ -481,5 +499,24 @@ public class FacesConfigParser
// We don't really want the included object - but return it anyway
return included;
}
+
+ abstract public void addDigesterRules(Digester includedDigester);
}
+
+ // Factory for component includes
+ static public class ComponentIncludeFactory extends AbstractIncludeFactory
+ {
+ public void addDigesterRules(Digester digester) {
+ addComponentDigesterRules(digester, false);
+ }
+ }
+
+ // Factory for component property includes
+ static public class ComponentPropertyIncludeFactory extends AbstractIncludeFactory
+ {
+ public void addDigesterRules(Digester digester) {
+ addComponentPropertyDigesterRules(digester);
+ }
+ }
+
}
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 11/17: TRINIDAD-1494 Support java.util.Set
as property type 1.2.10.1-branch of plugins. For Jing Wu
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit cd6a304c41a92a805bc7d09aff1a84400914ea20
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Fri Jun 5 02:16:56 2009 +0000
TRINIDAD-1494 Support java.util.Set as property type
1.2.10.1-branch of plugins.
For Jing Wu
---
.../plugin/faces/generator/GeneratorHelper.java | 11 ++++
.../taglib/TrinidadComponentTagGenerator.java | 63 ++++++++++++++++++++++
2 files changed, 74 insertions(+)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
index 52f573c..61d83dd 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
@@ -83,6 +83,17 @@ public class GeneratorHelper
"java.lang.String".equals(propClassParams[0]));
}
+ // Allows Set of known types, kept in sync
+ // with UIXComponentELTag's set*Set methods.
+ public static boolean isKnownTypeSet (
+ String propClass,
+ String[] propClassParams)
+ {
+ return ("java.util.Set".equals(propClass) &&
+ propClassParams.length == 1 &&
+ "java.lang.String".equals(propClassParams[0]));
+ }
+
public static boolean isColor(
String propClass)
{
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
index 885fb0d..3e4ceab 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
@@ -297,6 +297,12 @@ public class TrinidadComponentTagGenerator extends AbstractComponentTagGenerator
_writeSetKnownTypeList (out, componentClass, propName,
property.getPropertyClassParameters()[0]);
}
+ else if (GeneratorHelper.isKnownTypeSet(propClass,
+ property.getPropertyClassParameters()))
+ {
+ _writeSetKnownTypeSet (out, componentClass, propName,
+ property.getPropertyClassParameters()[0]);
+ }
else if (GeneratorHelper.isConverter(propClass))
{
_writeSetConverter(out, componentClass, propName);
@@ -913,6 +919,63 @@ public class TrinidadComponentTagGenerator extends AbstractComponentTagGenerator
}
+ private void _writeSetKnownTypeSet(
+ PrettyWriter out,
+ String componentClass,
+ String propName,
+ String propFullClass) throws IOException
+ {
+ String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+ String propVar = "_" + propName;
+
+ String propClass = Util.getClassFromFullClass(propFullClass);
+ String boxedClass = Util.getBoxedClass(propClass);
+
+ System.out.println ("_writeSetSet: propFullClass = " + propFullClass +
+ " propClass= " + propClass +
+ " boxedClass=" + boxedClass);
+ if (_is12)
+ {
+ out.println("set" + boxedClass + "SetProperty" +
+ "(bean, " + componentClass + "." + propKey +
+ ", " + propVar + ");");
+ }
+ else
+ {
+ out.println("if (" + propVar + " != null)");
+ out.println("{");
+ out.indent();
+ out.println("if (isValueReference(" + propVar + "))");
+ out.println("{");
+ out.indent();
+ out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+ out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+ out.unindent();
+ out.println("}");
+ out.println("else");
+ out.println("{");
+ out.indent();
+ out.println("try");
+ out.println("{");
+ out.indent();
+ out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+ out.println(" TagUtils.getStringSet(" + propVar + "));");
+ out.unindent();
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("setValidationError(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ out.unindent();
+ out.println("}");
+ out.unindent();
+ out.println("}");
+ }
+ }
+
private void _writeSetConverter(
PrettyWriter out,
String componentClass,
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 01/17: branching to 1.2.10.1-branch
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 3c083e9bd9371f15597cc6216a0507f8bab718b5
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Mar 3 22:21:00 2009 +0000
branching to 1.2.10.1-branch
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 06/17: TRINIDAD-1441 - Facelets: Need
Custom Validator and Converter handlers
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 662630c76a04deecdb1fb626d2c06ee46c9598c7
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Mon Apr 6 13:11:51 2009 +0000
TRINIDAD-1441 - Facelets: Need Custom Validator and Converter handlers
applied plugins related change. Thx to Max Starets
---
.../plugin/faces/GenerateFaceletsTaglibsMojo.java | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java
index 4c269b8..486e4d2 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java
@@ -328,6 +328,16 @@ public class GenerateFaceletsTaglibsMojo extends AbstractFacesMojo
validator.getValidatorId() : validator.getRootValidatorId();
stream.writeCharacters(id);
stream.writeEndElement();
+
+ String tagHandler = faceletValidatorHandlerClass;
+
+ if (tagHandler != null)
+ {
+ stream.writeCharacters("\n ");
+ stream.writeStartElement("handler-class");
+ stream.writeCharacters(tagHandler);
+ stream.writeEndElement();
+ }
stream.writeCharacters("\n ");
stream.writeEndElement();
@@ -356,6 +366,16 @@ public class GenerateFaceletsTaglibsMojo extends AbstractFacesMojo
converter.getConverterId() : converter.getRootConverterId();
stream.writeCharacters(id);
stream.writeEndElement();
+
+ String tagHandler = faceletConverterHandlerClass;
+
+ if (tagHandler != null)
+ {
+ stream.writeCharacters("\n ");
+ stream.writeStartElement("handler-class");
+ stream.writeCharacters(tagHandler);
+ stream.writeEndElement();
+ }
stream.writeCharacters("\n ");
stream.writeEndElement();
@@ -389,6 +409,16 @@ public class GenerateFaceletsTaglibsMojo extends AbstractFacesMojo
*@parameter
*/
private String faceletHandlerClass;
+
+ /**
+ *@parameter
+ */
+ private String faceletConverterHandlerClass;
+
+ /**
+ *@parameter
+ */
+ private String faceletValidatorHandlerClass;
/**
* @parameter expression="src/main/conf"
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 15/17: TRINIDAD-1656 - Maven-faces-plugin
faces-config.xml generation does not allow ViewRoot replacement
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 49d61e56dfb74a32a76f37a923a5b096ff70f35e
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Tue Dec 8 17:58:28 2009 +0000
TRINIDAD-1656 - Maven-faces-plugin faces-config.xml generation does not allow ViewRoot replacement
---
.../myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
index 0773dce..8b0f500 100644
--- a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
+++ b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
@@ -80,7 +80,8 @@
<xsl:apply-templates select="javaee:application" />
<xsl:apply-templates select="javaee:factory" />
<xsl:apply-templates select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(), 'abstract')) and
- starts-with(javaee:component-type, $typePrefix)]" />
+ (starts-with(javaee:component-type, $typePrefix) or
+ (contains(javaee:component-type, 'javax.faces.ViewRoot')))]" />
<xsl:apply-templates select="javaee:converter[contains(javaee:converter-class, $converterPackageContains)]" />
<xsl:apply-templates select="javaee:managed-bean[contains(javaee:managed-bean-class, $packageContains)]" />
<xsl:apply-templates select="javaee:navigation-rule" />
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 02/17: update pom.xml version to
1.2.10.1-SNAPSHOT
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit b39564e99939fdcb55aae5b165a3c730a0067ab3
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Mar 3 22:24:47 2009 +0000
update pom.xml version to
<version>1.2.10.1-SNAPSHOT</version>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index d02da96..37bd239 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.apache.myfaces.trinidadbuild</groupId>
<artifactId>maven-plugin-parent</artifactId>
- <version>1.2.10-SNAPSHOT</version>
+ <version>1.2.10.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache Trinidad Maven Plugin Parent</name>
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 10/17: TRINIDAD-1484 - Change Trinidad
metadata (build .xml files) to use jsr-276 metadata standard
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 993cf33839476ac0bd2f20078d9bd99339b96cc7
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Fri May 22 06:33:06 2009 +0000
TRINIDAD-1484 - Change Trinidad metadata (build .xml files) to use jsr-276 metadata standard
Committed the first part of this JIRA ticket, the plugins part
Thanks to Bill for his patch
---
.../myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index 9e05b61..45fb044 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -277,6 +277,12 @@ public class FacesConfigParser
digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/deprecated");
digester.addCallMethod("faces-config/component/property/property-extension/property-metadata/no-op", "makeNoOp");
+ // jsr-276 metadata rules
+ digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee/faces/design-time-metadata");
+ digester.addCallMethod("faces-config/component/property/property-extension/property-metadata/property-values",
+ "parsePropertyValues", 1);
+ digester.addCallParam("faces-config/component/property/property-extension/property-metadata/property-values", 0);
+
digester.setRuleNamespaceURI(oldNamespace);
}
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 17/17: Oops. restoring the branches. It
was not supposed to be deleted.
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 12947152788636eb2421a37c25388293e81d915d
Author: Scott Bryan <so...@apache.org>
AuthorDate: Thu Dec 22 17:43:30 2011 +0000
Oops. restoring the branches. It was not supposed to be deleted.
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 05/17: TRINIDAD-1438 - M2 Plugins: Need a
way to define a new converter or validator tag with the existing Id
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 6c2db849603d13d93f555e4a9093def32d520bba
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Wed Mar 25 21:03:29 2009 +0000
TRINIDAD-1438 - M2 Plugins: Need a way to define a new converter or validator tag with the existing Id
Thx to Max Starets for the patch
---
.../plugin/faces/GenerateFaceletsTaglibsMojo.java | 8 ++++++--
.../plugin/faces/parse/ConverterBean.java | 22 ++++++++++++++++++++++
.../plugin/faces/parse/FacesConfigParser.java | 4 ++++
.../plugin/faces/parse/ValidatorBean.java | 22 ++++++++++++++++++++++
4 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java
index d2d04cf..4c269b8 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateFaceletsTaglibsMojo.java
@@ -324,7 +324,9 @@ public class GenerateFaceletsTaglibsMojo extends AbstractFacesMojo
stream.writeStartElement("validator");
stream.writeCharacters("\n ");
stream.writeStartElement("validator-id");
- stream.writeCharacters(validator.getValidatorId());
+ String id = validator.getRootValidatorId() == null ?
+ validator.getValidatorId() : validator.getRootValidatorId();
+ stream.writeCharacters(id);
stream.writeEndElement();
stream.writeCharacters("\n ");
@@ -350,7 +352,9 @@ public class GenerateFaceletsTaglibsMojo extends AbstractFacesMojo
stream.writeStartElement("converter");
stream.writeCharacters("\n ");
stream.writeStartElement("converter-id");
- stream.writeCharacters(converter.getConverterId());
+ String id = converter.getRootConverterId() == null ?
+ converter.getConverterId() : converter.getRootConverterId();
+ stream.writeCharacters(id);
stream.writeEndElement();
stream.writeCharacters("\n ");
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ConverterBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ConverterBean.java
index 7937afa..25c14ac 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ConverterBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ConverterBean.java
@@ -58,6 +58,27 @@ public class ConverterBean extends AbstractTagBean {
{
return _converterId;
}
+
+ /**
+ * Sets the "root" converter Id representing the ID defined in faces-config
+ * The root id will be used while the tag definition is written out,
+ * while the regular Id is used for the lookup of existing converters.
+ * This allows us to define new tags for the existing converter IDs
+ * @param id root converter id
+ */
+ public void setRootConverterId(String id)
+ {
+ _rootConverterId = id;
+ }
+
+ /**
+ * Returns the root converter id
+ * @return root converter id
+ */
+ public String getRootConverterId()
+ {
+ return _rootConverterId;
+ }
/**
* Sets the converter class for this component.
@@ -141,6 +162,7 @@ public class ConverterBean extends AbstractTagBean {
private String _converterId;
+ private String _rootConverterId;
private String _converterClass;
private String _converterSuperClass;
private int _converterClassModifiers;
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index b9aff09..0de5e3f 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -289,6 +289,8 @@ public class FacesConfigParser
digester.setRuleNamespaceURI("http://myfaces.apache.org/maven-faces-plugin");
// faces-config/converter/converter-extension
+ digester.addBeanPropertySetter("faces-config/converter/converter-extension/root-converter-id",
+ "rootConverterId");
digester.addBeanPropertySetter("faces-config/converter/converter-extension/long-description",
"longDescription");
digester.addBeanPropertySetter("faces-config/converter/converter-extension/tag-class",
@@ -345,6 +347,8 @@ public class FacesConfigParser
digester.setRuleNamespaceURI("http://myfaces.apache.org/maven-faces-plugin");
// faces-config/validator/validator-extension
+ digester.addBeanPropertySetter("faces-config/validator/validator-extension/root-validator-id",
+ "rootValidatorId");
digester.addBeanPropertySetter("faces-config/validator/validator-extension/long-description",
"longDescription");
digester.addBeanPropertySetter("faces-config/validator/validator-extension/tag-class",
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ValidatorBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ValidatorBean.java
index aeec6bc..7b3f497 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ValidatorBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ValidatorBean.java
@@ -37,6 +37,27 @@ public class ValidatorBean extends AbstractTagBean {
{
_validatorId = validatorId;
}
+
+ /**
+ * Sets the "root" validator Id representing the ID defined in faces-config
+ * The root id will be used while the tag definition is written out,
+ * while the regular Id is used for the lookup of existing validators.
+ * This allows us to define new tags for the existing validator IDs
+ * @param id root validator id
+ */
+ public void setRootValidatorId(String id)
+ {
+ _rootValidatorId = id;
+ }
+
+ /**
+ * Returns the root validator id
+ * @return root validator id
+ */
+ public String getRootValidatorId()
+ {
+ return _rootValidatorId;
+ }
/**
* Returns true if the validator identifier is specified, otherwise false.
@@ -139,6 +160,7 @@ public class ValidatorBean extends AbstractTagBean {
}
private String _validatorId;
+ private String _rootValidatorId;
private String _validatorClass;
private String _validatorSuperClass;
private int _validatorClassModifiers;
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 14/17: TRINIDAD-1529 applied patch
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 7f1f415efe59b9227932432e918acbb8be8f1964
Author: Andrew Robinson <ar...@apache.org>
AuthorDate: Sat Jul 11 20:53:36 2009 +0000
TRINIDAD-1529
applied patch
---
.../plugin/faces/parse/AbstractTagBean.java | 60 +++++++++++-
.../plugin/faces/parse/FacesConfigParser.java | 10 ++
.../plugin/faces/parse/ScreenshotBean.java | 104 +++++++++++++++++++++
.../plugin/faces/resources/transform12.xsl | 1 +
.../trinidadbuild/plugin/tagdoc/TagdocReport.java | 90 +++++++++++++++---
5 files changed, 250 insertions(+), 15 deletions(-)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java
index d9cecdc..6ab3454 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/AbstractTagBean.java
@@ -33,7 +33,9 @@ public class AbstractTagBean extends ObjectBean {
private int _tagClassModifiers;
private Map _examples;
private int _exampleIdx = 0;
-
+ private Map _screenshots;
+ private int _screenshotIdx = 0;
+
public AbstractTagBean()
{
this(false);
@@ -50,6 +52,7 @@ public class AbstractTagBean extends ObjectBean {
_properties = new LinkedHashMap();
}
_examples = new LinkedHashMap();
+ _screenshots = new LinkedHashMap();
}
/**
@@ -225,6 +228,51 @@ public class AbstractTagBean extends ObjectBean {
return _examples.values().iterator();
}
+ /**
+ * Adds a Screenshot to this component.
+ *
+ * @param screenshot the screenshot to add
+ */
+ public void addScreenshot(
+ ScreenshotBean screenshot)
+ {
+ String key = _generateScreenshotKey();
+ screenshot.setKey(key);
+ _screenshots.put(key, screenshot);
+ }
+
+ /**
+ * Returns true if this component has any screenshots.
+ *
+ * @return true if this component has any screenshots,
+ * false otherwise
+ */
+ public boolean hasScreenshots()
+ {
+ return !_screenshots.isEmpty();
+ }
+
+ /**
+ * Returns the screenshot for this screenshot key.
+ *
+ * @param key the hashmap screenshot key
+ */
+ public ScreenshotBean findScreenshot(
+ String key)
+ {
+ return (ScreenshotBean)_screenshots.get(key);
+ }
+
+ /**
+ * Returns an iterator for all screenshots on this component only.
+ *
+ * @return the screenshot iterator
+ */
+ public Iterator screenshots()
+ {
+ return _screenshots.values().iterator();
+ }
+
public void parseTagClassModifier(
String modifier)
{
@@ -297,4 +345,14 @@ public class AbstractTagBean extends ObjectBean {
_exampleIdx++;
return key;
}
+
+ /* Get a generated key to use in storing
+ * this screen shot bean in its hashmap.
+ */
+ private String _generateScreenshotKey()
+ {
+ String key = "Screenshot" + Integer.toString(_screenshotIdx);
+ _screenshotIdx++;
+ return key;
+ }
}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index dae2548..55f0a2d 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -188,6 +188,16 @@ public class FacesConfigParser
digester.addSetNext("faces-config/component/component-extension/example",
"addExample", ExampleBean.class.getName());
+ // faces-config/component/component-extension/screenshot
+ digester.addObjectCreate("faces-config/component/component-extension/screenshot",
+ ScreenshotBean.class);
+ digester.addBeanPropertySetter("faces-config/component/component-extension/screenshot/description",
+ "description");
+ digester.addBeanPropertySetter("faces-config/component/component-extension/screenshot/image",
+ "image");
+ digester.addSetNext("faces-config/component/component-extension/screenshot",
+ "addScreenshot", ScreenshotBean.class.getName());
+
// faces-config/component/component-extension/event
digester.addObjectCreate("faces-config/component/component-extension/event", EventRefBean.class);
digester.addBeanPropertySetter("faces-config/component/component-extension/event/event-type",
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ScreenshotBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ScreenshotBean.java
new file mode 100644
index 0000000..8b0a0d7
--- /dev/null
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ScreenshotBean.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.apache.myfaces.trinidadbuild.plugin.faces.parse;
+
+/**
+ * ScreenshotBean is a Java representation of the faces-config mfp:screenshot
+ * XML element.
+ * An example of how the ScreenshotBean would be represented as an XML element is:
+ * <mfp:screenshot>
+ * <mfp:image>
+ * <![CDATA[
+ * <img src="../images/inputDate.png" alt="inputDate screenshot"></img>
+ * ]]>
+ * </mfp:image>
+ * <mfp:description>
+ * inputDate component as shown when rendered in a simple form
+ * </mfp:description>
+ * </mfp:screenshot>
+ */
+public class ScreenshotBean extends ObjectBean
+{
+ /**
+ * Get Description Text. The description text is used as a caption for the screen
+ * shot image in the generated tag doc.
+ *
+ * @return Screenshot Description Text
+ */
+ public String getDescription()
+ {
+ return _description;
+ }
+
+ /**
+ * Set screenshot Description Text. The description text is used as a caption for the screen
+ * shot image in the generated tag doc.
+ *
+ * @param description screenshot Description Text.
+ */
+ public void setDescription( String description )
+ {
+ _description = description;
+ }
+
+ /**
+ * Returns image Screenshot.
+ *
+ * @return image Screenshot
+ */
+ public String getImage()
+ {
+ return _image;
+ }
+
+ /**
+ * Set image for screenshot.
+ *
+ * @param image image screenshot to be added to the list.
+ */
+ public void setImage( String image )
+ {
+ _image = image;
+ }
+
+ /**
+ * Returns Screenshot hashmap key.
+ *
+ * @return Screenshot hashmap key
+ */
+ public String getKey()
+ {
+ return _key;
+ }
+
+ /**
+ * Set hashmap key for this screenshot.
+ *
+ * @param key Set key for this screenshot put in
+ * ComponentBean _screenshots hashmap.
+ */
+ protected void setKey( String key )
+ {
+ _key = key;
+ }
+
+ private String _description = null;
+ private String _image = null;
+ private String _key = null;
+}
diff --git a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
index 3a87320..0773dce 100644
--- a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
+++ b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
@@ -1055,6 +1055,7 @@
<xsl:template match="//mfp:jsp-property-name" />
<xsl:template match="//mfp:long-description" />
<xsl:template match="//mfp:method-binding-signature" />
+ <xsl:template match="//mfp:screenshot" />
<xsl:template match="//mfp:short-description" />
<xsl:template match="//mfp:state-holder" />
<xsl:template match="//mfp:tag-attribute-excluded" />
diff --git a/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java b/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
index 6ed5033..6ced162 100644
--- a/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
+++ b/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
@@ -62,6 +62,7 @@ import org.apache.myfaces.trinidadbuild.plugin.faces.parse.FacesConfigBean;
import org.apache.myfaces.trinidadbuild.plugin.faces.parse.FacesConfigParser;
import org.apache.myfaces.trinidadbuild.plugin.faces.parse.FacetBean;
import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ScreenshotBean;
import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ValidatorBean;
import org.apache.myfaces.trinidadbuild.plugin.faces.util.ComponentFilter;
import org.apache.myfaces.trinidadbuild.plugin.faces.util.ConverterFilter;
@@ -401,11 +402,12 @@ public class TagdocReport extends AbstractMavenMultiPageReport
out.write(" <p>\n");
_writeComponentSummary(out, component);
out.write(" </p>\n");
- out.write(" <p>\n");
- _writeExamples(out, component);
- out.write(" </p>\n");
out.write(" </section>\n");
-
+
+ _writeScreenshots(out, component);
+
+ _writeExamples(out, component);
+
if (component.hasEvents(true))
{
out.write(" <section name=\"Events\">\n");
@@ -469,11 +471,12 @@ public class TagdocReport extends AbstractMavenMultiPageReport
out.write(" <p>\n");
_writeConverterSummary(out, converter);
out.write(" </p>\n");
- out.write(" <p>\n");
- _writeExamples(out, converter);
- out.write(" </p>\n");
out.write(" </section>\n");
-
+
+ _writeScreenshots(out, converter);
+
+ _writeExamples(out, converter);
+
out.write(" <section name=\"Attributes\">\n");
_writeConverterAttributes(out, converter);
out.write(" </section>\n");
@@ -519,11 +522,12 @@ public class TagdocReport extends AbstractMavenMultiPageReport
out.write(" <p>\n");
_writeValidatorSummary(out, validator);
out.write(" </p>\n");
- out.write(" <p>\n");
- _writeExamples(out, validator);
- out.write(" </p>\n");
out.write(" </section>\n");
-
+
+ _writeScreenshots(out, validator);
+
+ _writeExamples(out, validator);
+
out.write(" <section name=\"Attributes\">\n");
_writeValidatorAttributes(out, validator);
out.write(" </section>\n");
@@ -1062,8 +1066,8 @@ public class TagdocReport extends AbstractMavenMultiPageReport
ExampleBean exBean = null;
// Write header
- out.write(" <b>Example(s):</b> ");
- out.write(" <br/>\n");
+ out.write(" <section name=\"Code Example(s)\">\n");
+ out.write(" <p>\n");
out.write(" <html>\n");
// Go through each example, write its description
@@ -1097,6 +1101,64 @@ public class TagdocReport extends AbstractMavenMultiPageReport
}
}
out.write(" </html>\n");
+ out.write(" </p>\n");
+ out.write(" </section>\n");
+ }
+
+ private void _writeScreenshots(Writer out, AbstractTagBean bean) throws IOException
+ {
+ if (!bean.hasScreenshots())
+ return;
+
+ ScreenshotBean ssBean = null;
+
+ // Write header
+ out.write(" <section name=\"Screenshot(s)\">\n");
+ out.write(" <p>\n");
+ out.write(" <html>\n");
+
+ // Go through each screenshot, write its image
+ // followed by the image's caption.
+ Iterator iter = bean.screenshots();
+ while (iter.hasNext())
+ {
+ ssBean = (ScreenshotBean) iter.next();
+ String desc = ssBean.getDescription();
+ String img = ssBean.getImage();
+
+ out.write(" <div class=\'screenshot\'>\n");
+
+ if (img != null)
+ {
+ if (!"".equals(img))
+ {
+ out.write(img);
+ }
+ }
+
+ if (desc != null)
+ {
+ desc = desc.replaceAll("<", "<");
+ desc = desc.replaceAll(">", ">");
+
+ if (!"".equals(desc))
+ {
+ out.write("<br/>");
+ out.write(desc + "\n");
+ }
+ }
+ out.write(" </div>\n");
+
+ // create extra space between each screenshot to ensure it is clear which description
+ // text belongs to which image
+ if (iter.hasNext())
+ {
+ out.write("<br/>");
+ }
+ }
+ out.write(" </html>\n");
+ out.write(" </p>\n");
+ out.write(" </section>\n");
}
protected MavenProject getProject()
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 09/17: TRINIDAD-1476 - Unnecessary tr and
trh namespace declarations in faces-config.xml
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit ca551ad11d89dbd3b29636549c1de5e82c97b0db
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Wed May 20 05:57:41 2009 +0000
TRINIDAD-1476 - Unnecessary tr and trh namespace declarations in faces-config.xml
Thx to Bill Baggett for the patch
---
.../myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
index 6ca5f27..3a87320 100644
--- a/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
+++ b/maven-faces-plugin/src/main/resources/org/apache/myfaces/trinidadbuild/plugin/faces/resources/transform12.xsl
@@ -50,6 +50,12 @@
<xsl:template match="//text()" />
<!-- these are used for inserting a namespace declaration in xslt 1.0 -->
+ <xsl:variable name="tr">
+ <xsl:element name="tr:xxx" namespace="http://myfaces.apache.org/trinidad"/>
+ </xsl:variable>
+ <xsl:variable name="trh">
+ <xsl:element name="trh:xxx" namespace="http://myfaces.apache.org/trinidad/html"/>
+ </xsl:variable>
<xsl:variable name="fmd">
<xsl:element name="fmd:xxx" namespace="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata"/>
</xsl:variable>
@@ -64,6 +70,8 @@
<xsl:element name="faces-config"
namespace="http://java.sun.com/xml/ns/javaee" >
<!-- Add namespace declarations at root element, so they don't show up at lower elements when we change namespaces -->
+ <xsl:copy-of select="exsl:node-set($tr)//namespace::*"/>
+ <xsl:copy-of select="exsl:node-set($trh)//namespace::*"/>
<xsl:copy-of select="exsl:node-set($fmd)//namespace::*"/>
<xsl:copy-of select="exsl:node-set($mfp)//namespace::*"/>
<xsl:copy-of select="exsl:node-set($mafp)//namespace::*"/>
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 04/17: TRINIDAD-1414 - Implement support
for specifying List attribute type as String
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 7ceef5ad1e7977969064bd1843653fb2a4ebf66f
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Fri Mar 20 06:36:51 2009 +0000
TRINIDAD-1414 - Implement support for specifying List<String> attribute type as String
Applying the plugin specific patch;
Thanks to Yee-wah Lee
---
.../plugin/faces/generator/GeneratorHelper.java | 11 ++++
.../taglib/TrinidadComponentTagGenerator.java | 63 ++++++++++++++++++++++
2 files changed, 74 insertions(+)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
index 6070690..52f573c 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/GeneratorHelper.java
@@ -72,6 +72,17 @@ public class GeneratorHelper
"java.awt.Color".equals(propClassParams[0]));
}
+ // Allows List of known types, kept in sync
+ // with UIXComponentELTag's set*List methods.
+ public static boolean isKnownTypeList (
+ String propClass,
+ String[] propClassParams)
+ {
+ return ("java.util.List".equals(propClass) &&
+ propClassParams.length == 1 &&
+ "java.lang.String".equals(propClassParams[0]));
+ }
+
public static boolean isColor(
String propClass)
{
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
index 72e06b7..885fb0d 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/taglib/TrinidadComponentTagGenerator.java
@@ -291,6 +291,12 @@ public class TrinidadComponentTagGenerator extends AbstractComponentTagGenerator
{
_writeSetColor(out, componentClass, propName, false);
}
+ else if (GeneratorHelper.isKnownTypeList(propClass,
+ property.getPropertyClassParameters()))
+ {
+ _writeSetKnownTypeList (out, componentClass, propName,
+ property.getPropertyClassParameters()[0]);
+ }
else if (GeneratorHelper.isConverter(propClass))
{
_writeSetConverter(out, componentClass, propName);
@@ -849,6 +855,63 @@ public class TrinidadComponentTagGenerator extends AbstractComponentTagGenerator
out.println("}");
}
+ private void _writeSetKnownTypeList(
+ PrettyWriter out,
+ String componentClass,
+ String propName,
+ String propFullClass) throws IOException
+ {
+ String propKey = Util.getConstantNameFromProperty(propName, "_KEY");
+ String propVar = "_" + propName;
+
+ String propClass = Util.getClassFromFullClass(propFullClass);
+ String boxedClass = Util.getBoxedClass(propClass);
+
+ System.out.println ("_writeSetList: propFullClass = " + propFullClass +
+ " propClass= " + propClass +
+ " boxedClass=" + boxedClass);
+ if (_is12)
+ {
+ out.println("set" + boxedClass + "ListProperty" +
+ "(bean, " + componentClass + "." + propKey +
+ ", " + propVar + ");");
+ }
+ else
+ {
+ out.println("if (" + propVar + " != null)");
+ out.println("{");
+ out.indent();
+ out.println("if (isValueReference(" + propVar + "))");
+ out.println("{");
+ out.indent();
+ out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
+ out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+ out.unindent();
+ out.println("}");
+ out.println("else");
+ out.println("{");
+ out.indent();
+ out.println("try");
+ out.println("{");
+ out.indent();
+ out.println("bean.setProperty(" + componentClass + "." + propKey + ",");
+ out.println(" TagUtils.getStringList(" + propVar + "));");
+ out.unindent();
+ out.println("}");
+ out.println("catch (ParseException pe)");
+ out.println("{");
+ out.indent();
+ out.println("setValidationError(");
+ out.println(" pe.getMessage() + \": \" + \"Position \" + pe.getErrorOffset());");
+ out.unindent();
+ out.println("}");
+ out.unindent();
+ out.println("}");
+ out.unindent();
+ out.println("}");
+ }
+ }
+
private void _writeSetConverter(
PrettyWriter out,
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.
[myfaces-trinidad-maven] 12/17: TRINIDAD-1499 - Regression issues
with jsp tag class generation from move to jsr276 metadata
Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.10.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 5a0991b949e898770d0e535d6b7f30d70da45c59
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Sat Jun 6 00:45:42 2009 +0000
TRINIDAD-1499 - Regression issues with jsp tag class generation from move to jsr276 metadata
Thanks to Bill Baggett for his patch
---
.../myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java | 3 +--
.../myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java | 1 +
.../myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java | 6 ++++++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
index 3bd4825..3fbecae 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
@@ -610,8 +610,7 @@ public class GenerateJspTaglibsMojo extends AbstractFacesMojo
}
stream.writeEndElement();
}
- else if ((!property.isLiteralOnly() &&
- (!(property.getValueExpression() != null && property.getValueExpression().equals("PROHIBITED")))) ||
+ else if (!property.isLiteralOnly() ||
// "binding" is always a deferred-value
"binding".equals(propertyName))
{
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index 45fb044..dae2548 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -282,6 +282,7 @@ public class FacesConfigParser
digester.addCallMethod("faces-config/component/property/property-extension/property-metadata/property-values",
"parsePropertyValues", 1);
digester.addCallParam("faces-config/component/property/property-extension/property-metadata/property-values", 0);
+ digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/deprecated");
digester.setRuleNamespaceURI(oldNamespace);
}
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java
index 1f1a36d..2f7c6f0 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/PropertyBean.java
@@ -507,6 +507,12 @@ public class PropertyBean extends AttributeBean
public void setValueExpression(String valueExpression)
{
this._valueExpression = valueExpression;
+ // This is for backward compatibility from jsr-276 metadata. The old element
+ // <mfp:literal-only>true</mfp:literal-only> is now
+ // <fmd:value-expression>PROHIBITED</fmd:value-expression>. There are a number of places
+ // that look at literalOnly, so we just make it transparent at the lowest level.
+ if (valueExpression.equals("PROHIBITED"))
+ setLiteralOnly(true);
}
/**
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.