You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shale.apache.org by he...@apache.org on 2007/03/13 14:25:09 UTC
svn commit: r517688 - in /shale/framework/trunk: shale-application/
shale-apps/mailreader-jpa/ shale-apps/shale-blank/
shale-apps/shale-clay-usecases/ shale-apps/shale-mailreader-jpa/
shale-apps/shale-mailreader/ shale-apps/shale-sql-browser/ shale-app...
Author: hermod
Date: Tue Mar 13 06:25:08 2007
New Revision: 517688
URL: http://svn.apache.org/viewvc?view=rev&rev=517688
Log:
Added mising Tag handlers for validators and converters, and also updated the ignore list
Added:
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleConverterTag.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleValidatorTag.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatConverterTag.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatValidatorTag.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongConverterTag.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongValidatorTag.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortConverterTag.java
shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortValidatorTag.java
Modified:
shale/framework/trunk/shale-application/ (props changed)
shale/framework/trunk/shale-apps/mailreader-jpa/ (props changed)
shale/framework/trunk/shale-apps/shale-blank/ (props changed)
shale/framework/trunk/shale-apps/shale-clay-usecases/ (props changed)
shale/framework/trunk/shale-apps/shale-mailreader/ (props changed)
shale/framework/trunk/shale-apps/shale-mailreader-jpa/ (props changed)
shale/framework/trunk/shale-apps/shale-sql-browser/ (props changed)
shale/framework/trunk/shale-apps/shale-test-tiger/ (props changed)
shale/framework/trunk/shale-apps/shale-usecases/ (props changed)
shale/framework/trunk/shale-clay/ (props changed)
shale/framework/trunk/shale-core/ (props changed)
shale/framework/trunk/shale-dialog/ (props changed)
shale/framework/trunk/shale-dialog-basic/ (props changed)
shale/framework/trunk/shale-dialog-scxml/ (props changed)
shale/framework/trunk/shale-remoting/ (props changed)
shale/framework/trunk/shale-spring/ (props changed)
shale/framework/trunk/shale-test/ (props changed)
shale/framework/trunk/shale-tiger/ (props changed)
shale/framework/trunk/shale-tiles/ (props changed)
shale/framework/trunk/shale-validator/ (props changed)
shale/framework/trunk/shale-view/ (props changed)
Propchange: shale/framework/trunk/shale-application/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-apps/mailreader-jpa/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,2 +1,4 @@
*.iml
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-apps/shale-blank/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,2 +1,4 @@
pom.xml~
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-apps/shale-clay-usecases/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,4 @@
target
+.classpath
+.project
+.settings
Propchange: shale/framework/trunk/shale-apps/shale-mailreader/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,2 +1,4 @@
pom.xml~
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-apps/shale-mailreader-jpa/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-apps/shale-sql-browser/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,3 +1,5 @@
pom.xml~
target
META-INF
+.project
+.classpath
Propchange: shale/framework/trunk/shale-apps/shale-test-tiger/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-apps/shale-usecases/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,2 +1,4 @@
pom.xml~
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-clay/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,5 @@
target
+.hiberclipse
+.project
+.settings
+.classpath
Propchange: shale/framework/trunk/shale-core/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,3 +1,7 @@
dist
target
pom.xml~
+.project
+.settings
+.checkstyle
+.classpath
Propchange: shale/framework/trunk/shale-dialog/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-dialog-basic/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-dialog-scxml/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-remoting/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,2 +1,4 @@
pom.xml~
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-spring/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,2 +1,4 @@
pom.xml~
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-test/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -2,3 +2,6 @@
*.iml
*.ipr
*.iws
+.project
+.settings
+.classpath
Propchange: shale/framework/trunk/shale-tiger/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -3,3 +3,6 @@
shale-tiger.iml
shale-tiger.ipr
shale-tiger.iws
+.project
+.settings
+.classpath
Propchange: shale/framework/trunk/shale-tiles/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1,2 +1,4 @@
pom.xml~
target
+.project
+.classpath
Propchange: shale/framework/trunk/shale-validator/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleConverterTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleConverterTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleConverterTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleConverterTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,130 @@
+/*
+ * 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.shale.validator.tag;
+
+import java.util.Locale;
+
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.ConverterTag;
+import javax.faces.webapp.UIComponentTag;
+
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.converter.DoubleConverter;
+
+/**
+ * <p>JSP custom action for <code>DoubleConverter</code>.</p>
+ */
+public final class DoubleConverterTag extends ConverterTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String locale = null;
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String pattern = null;
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ locale = null;
+ message = null;
+ pattern = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ConverterTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Converter</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Converter createConverter() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ DoubleConverter converter = new DoubleConverter();
+
+ if (locale != null) {
+ Locale value = null;
+ if (UIComponentTag.isValueReference(locale)) {
+ ValueBinding vb = context.getApplication().createValueBinding(locale);
+ value = (Locale) vb.getValue(context);
+ } else {
+ value = (Locale) HELPER.asObject(context, Locale.class, locale);
+ }
+ converter.setLocale(value);
+ }
+
+ if (pattern != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(pattern);
+ value = (String) vb.getValue(context);
+ } else {
+ value = pattern;
+ }
+ converter.setPattern(value);
+ }
+
+ return converter;
+
+ }
+
+
+}
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleValidatorTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleValidatorTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleValidatorTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/DoubleValidatorTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,156 @@
+/*
+ * 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.shale.validator.tag;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.validator.Validator;
+import javax.faces.webapp.UIComponentTag;
+import javax.faces.webapp.ValidatorTag;
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.validator.DoubleValidator;
+
+/**
+ * <p>JSP custom action for <code>DoubleValidator</code>.</p>
+ */
+public final class DoubleValidatorTag extends ValidatorTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String client = null;
+ public void setClient(String client) {
+ this.client = client;
+ }
+
+
+ private String maximum = null;
+ public void setMaximum(String maximum) {
+ this.maximum = maximum;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String minimum = null;
+ public void setMinimum(String minimum) {
+ this.minimum = minimum;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ client = null;
+ maximum = null;
+ message = null;
+ minimum = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ValidatorTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Validator</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Validator createValidator() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ DoubleValidator validator = new DoubleValidator();
+
+ if (client != null) {
+ Boolean value = null;
+ if (UIComponentTag.isValueReference(client)) {
+ ValueBinding vb = context.getApplication().createValueBinding(client);
+ value = (Boolean) vb.getValue(context);
+ } else {
+ value = (Boolean) HELPER.asObject(context, Boolean.class, client);
+ }
+ validator.setClient(value.booleanValue());
+ }
+
+ if (maximum != null) {
+ Double value = null;
+ if (UIComponentTag.isValueReference(maximum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(maximum);
+ value = (Double) vb.getValue(context);
+ } else {
+ value = (Double) HELPER.asObject(context, Double.class, maximum);
+ }
+ validator.setMaximum(value.doubleValue());
+ }
+
+ if (message != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(message);
+ value = (String) vb.getValue(context);
+ } else {
+ value = message;
+ }
+ validator.setMessage(value);
+ }
+
+ if (minimum != null) {
+ Double value = null;
+ if (UIComponentTag.isValueReference(minimum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(minimum);
+ value = (Double) vb.getValue(context);
+ } else {
+ value = (Double) HELPER.asObject(context, Double.class, minimum);
+ }
+ validator.setMinimum(value.doubleValue());
+ }
+
+ return validator;
+
+ }
+
+
+}
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatConverterTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatConverterTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatConverterTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatConverterTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,130 @@
+/*
+ * 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.shale.validator.tag;
+
+import java.util.Locale;
+
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.ConverterTag;
+import javax.faces.webapp.UIComponentTag;
+
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.converter.FloatConverter;
+
+/**
+ * <p>JSP custom action for <code>FloatConverter</code>.</p>
+ */
+public final class FloatConverterTag extends ConverterTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String locale = null;
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String pattern = null;
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ locale = null;
+ message = null;
+ pattern = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ConverterTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Converter</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Converter createConverter() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ FloatConverter converter = new FloatConverter();
+
+ if (locale != null) {
+ Locale value = null;
+ if (UIComponentTag.isValueReference(locale)) {
+ ValueBinding vb = context.getApplication().createValueBinding(locale);
+ value = (Locale) vb.getValue(context);
+ } else {
+ value = (Locale) HELPER.asObject(context, Locale.class, locale);
+ }
+ converter.setLocale(value);
+ }
+
+ if (pattern != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(pattern);
+ value = (String) vb.getValue(context);
+ } else {
+ value = pattern;
+ }
+ converter.setPattern(value);
+ }
+
+ return converter;
+
+ }
+
+
+}
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatValidatorTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatValidatorTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatValidatorTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/FloatValidatorTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,156 @@
+/*
+ * 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.shale.validator.tag;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.validator.Validator;
+import javax.faces.webapp.UIComponentTag;
+import javax.faces.webapp.ValidatorTag;
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.validator.FloatValidator;
+
+/**
+ * <p>JSP custom action for <code>FloatValidator</code>.</p>
+ */
+public final class FloatValidatorTag extends ValidatorTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String client = null;
+ public void setClient(String client) {
+ this.client = client;
+ }
+
+
+ private String maximum = null;
+ public void setMaximum(String maximum) {
+ this.maximum = maximum;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String minimum = null;
+ public void setMinimum(String minimum) {
+ this.minimum = minimum;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ client = null;
+ maximum = null;
+ message = null;
+ minimum = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ValidatorTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Validator</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Validator createValidator() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ FloatValidator validator = new FloatValidator();
+
+ if (client != null) {
+ Boolean value = null;
+ if (UIComponentTag.isValueReference(client)) {
+ ValueBinding vb = context.getApplication().createValueBinding(client);
+ value = (Boolean) vb.getValue(context);
+ } else {
+ value = (Boolean) HELPER.asObject(context, Boolean.class, client);
+ }
+ validator.setClient(value.booleanValue());
+ }
+
+ if (maximum != null) {
+ Float value = null;
+ if (UIComponentTag.isValueReference(maximum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(maximum);
+ value = (Float) vb.getValue(context);
+ } else {
+ value = (Float) HELPER.asObject(context, Float.class, maximum);
+ }
+ validator.setMaximum(value.floatValue());
+ }
+
+ if (message != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(message);
+ value = (String) vb.getValue(context);
+ } else {
+ value = message;
+ }
+ validator.setMessage(value);
+ }
+
+ if (minimum != null) {
+ Float value = null;
+ if (UIComponentTag.isValueReference(minimum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(minimum);
+ value = (Float) vb.getValue(context);
+ } else {
+ value = (Float) HELPER.asObject(context, Float.class, minimum);
+ }
+ validator.setMinimum(value.floatValue());
+ }
+
+ return validator;
+
+ }
+
+
+}
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongConverterTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongConverterTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongConverterTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongConverterTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,130 @@
+/*
+ * 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.shale.validator.tag;
+
+import java.util.Locale;
+
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.ConverterTag;
+import javax.faces.webapp.UIComponentTag;
+
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.converter.LongConverter;
+
+/**
+ * <p>JSP custom action for <code>LongConverter</code>.</p>
+ */
+public final class LongConverterTag extends ConverterTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String locale = null;
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String pattern = null;
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ locale = null;
+ message = null;
+ pattern = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ConverterTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Converter</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Converter createConverter() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ LongConverter converter = new LongConverter();
+
+ if (locale != null) {
+ Locale value = null;
+ if (UIComponentTag.isValueReference(locale)) {
+ ValueBinding vb = context.getApplication().createValueBinding(locale);
+ value = (Locale) vb.getValue(context);
+ } else {
+ value = (Locale) HELPER.asObject(context, Locale.class, locale);
+ }
+ converter.setLocale(value);
+ }
+
+ if (pattern != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(pattern);
+ value = (String) vb.getValue(context);
+ } else {
+ value = pattern;
+ }
+ converter.setPattern(value);
+ }
+
+ return converter;
+
+ }
+
+
+}
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongValidatorTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongValidatorTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongValidatorTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/LongValidatorTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,156 @@
+/*
+ * 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.shale.validator.tag;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.validator.Validator;
+import javax.faces.webapp.UIComponentTag;
+import javax.faces.webapp.ValidatorTag;
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.validator.LongValidator;
+
+/**
+ * <p>JSP custom action for <code>LongValidator</code>.</p>
+ */
+public final class LongValidatorTag extends ValidatorTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String client = null;
+ public void setClient(String client) {
+ this.client = client;
+ }
+
+
+ private String maximum = null;
+ public void setMaximum(String maximum) {
+ this.maximum = maximum;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String minimum = null;
+ public void setMinimum(String minimum) {
+ this.minimum = minimum;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ client = null;
+ maximum = null;
+ message = null;
+ minimum = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ValidatorTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Validator</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Validator createValidator() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ LongValidator validator = new LongValidator();
+
+ if (client != null) {
+ Boolean value = null;
+ if (UIComponentTag.isValueReference(client)) {
+ ValueBinding vb = context.getApplication().createValueBinding(client);
+ value = (Boolean) vb.getValue(context);
+ } else {
+ value = (Boolean) HELPER.asObject(context, Boolean.class, client);
+ }
+ validator.setClient(value.booleanValue());
+ }
+
+ if (maximum != null) {
+ Long value = null;
+ if (UIComponentTag.isValueReference(maximum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(maximum);
+ value = (Long) vb.getValue(context);
+ } else {
+ value = (Long) HELPER.asObject(context, Long.class, maximum);
+ }
+ validator.setMaximum(value.longValue());
+ }
+
+ if (message != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(message);
+ value = (String) vb.getValue(context);
+ } else {
+ value = message;
+ }
+ validator.setMessage(value);
+ }
+
+ if (minimum != null) {
+ Long value = null;
+ if (UIComponentTag.isValueReference(minimum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(minimum);
+ value = (Long) vb.getValue(context);
+ } else {
+ value = (Long) HELPER.asObject(context, Long.class, minimum);
+ }
+ validator.setMinimum(value.longValue());
+ }
+
+ return validator;
+
+ }
+
+
+}
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortConverterTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortConverterTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortConverterTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortConverterTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,130 @@
+/*
+ * 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.shale.validator.tag;
+
+import java.util.Locale;
+
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.ValueBinding;
+import javax.faces.webapp.ConverterTag;
+import javax.faces.webapp.UIComponentTag;
+
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.converter.ShortConverter;
+
+/**
+ * <p>JSP custom action for <code>ShortConverter</code>.</p>
+ */
+public final class ShortConverterTag extends ConverterTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String locale = null;
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String pattern = null;
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ locale = null;
+ message = null;
+ pattern = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ConverterTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Converter</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Converter createConverter() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ ShortConverter converter = new ShortConverter();
+
+ if (locale != null) {
+ Locale value = null;
+ if (UIComponentTag.isValueReference(locale)) {
+ ValueBinding vb = context.getApplication().createValueBinding(locale);
+ value = (Locale) vb.getValue(context);
+ } else {
+ value = (Locale) HELPER.asObject(context, Locale.class, locale);
+ }
+ converter.setLocale(value);
+ }
+
+ if (pattern != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(pattern);
+ value = (String) vb.getValue(context);
+ } else {
+ value = pattern;
+ }
+ converter.setPattern(value);
+ }
+
+ return converter;
+
+ }
+
+
+}
Added: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortValidatorTag.java
URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortValidatorTag.java?view=auto&rev=517688
==============================================================================
--- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortValidatorTag.java (added)
+++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/ShortValidatorTag.java Tue Mar 13 06:25:08 2007
@@ -0,0 +1,156 @@
+/*
+ * 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.shale.validator.tag;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.faces.validator.Validator;
+import javax.faces.webapp.UIComponentTag;
+import javax.faces.webapp.ValidatorTag;
+import org.apache.shale.util.ConverterHelper;
+import org.apache.shale.validator.validator.ShortValidator;
+
+/**
+ * <p>JSP custom action for <code>ShortValidator</code>.</p>
+ */
+public final class ShortValidatorTag extends ValidatorTag {
+
+
+ // -------------------------------------------------------- Static Variables
+
+
+ /**
+ * Serial version UID.
+ */
+ private static final long serialVersionUID = 1L;
+
+
+ /**
+ * <p>Helper object for performing conversions.</p>
+ */
+ private static final ConverterHelper HELPER =
+ new ConverterHelper();
+
+
+ // -------------------------------------------------------------- Properties
+
+
+ private String client = null;
+ public void setClient(String client) {
+ this.client = client;
+ }
+
+
+ private String maximum = null;
+ public void setMaximum(String maximum) {
+ this.maximum = maximum;
+ }
+
+
+ private String message = null;
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+
+ private String minimum = null;
+ public void setMinimum(String minimum) {
+ this.minimum = minimum;
+ }
+
+
+ // ------------------------------------------------------------- Tag Methods
+
+
+ /**
+ * <p>Release resources allocated for this instance.</p>
+ */
+ public void release() {
+
+ client = null;
+ maximum = null;
+ message = null;
+ minimum = null;
+
+ super.release();
+
+ }
+
+
+ // ---------------------------------------------------- ValidatorTag Methods
+
+
+ /**
+ * <p>Create and return a new <code>Validator</code> instance to be
+ * registered on our corresponding <code>UIComponent</code>.</p>
+ */
+ protected Validator createValidator() {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ ShortValidator validator = new ShortValidator();
+
+ if (client != null) {
+ Boolean value = null;
+ if (UIComponentTag.isValueReference(client)) {
+ ValueBinding vb = context.getApplication().createValueBinding(client);
+ value = (Boolean) vb.getValue(context);
+ } else {
+ value = (Boolean) HELPER.asObject(context, Boolean.class, client);
+ }
+ validator.setClient(value.booleanValue());
+ }
+
+ if (maximum != null) {
+ Short value = null;
+ if (UIComponentTag.isValueReference(maximum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(maximum);
+ value = (Short) vb.getValue(context);
+ } else {
+ value = (Short) HELPER.asObject(context, Short.class, maximum);
+ }
+ validator.setMaximum(value.shortValue());
+ }
+
+ if (message != null) {
+ String value = null;
+ if (UIComponentTag.isValueReference(message)) {
+ ValueBinding vb = context.getApplication().createValueBinding(message);
+ value = (String) vb.getValue(context);
+ } else {
+ value = message;
+ }
+ validator.setMessage(value);
+ }
+
+ if (minimum != null) {
+ Short value = null;
+ if (UIComponentTag.isValueReference(minimum)) {
+ ValueBinding vb = context.getApplication().createValueBinding(minimum);
+ value = (Short) vb.getValue(context);
+ } else {
+ value = (Short) HELPER.asObject(context, Short.class, minimum);
+ }
+ validator.setMinimum(value.shortValue());
+ }
+
+ return validator;
+
+ }
+
+
+}
Propchange: shale/framework/trunk/shale-view/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Mar 13 06:25:08 2007
@@ -1 +1,3 @@
target
+.project
+.classpath