Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java90
1 files changed, 0 insertions, 90 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java
deleted file mode 100644
index a7791e974..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-package org.eclipse.jst.jsf.taglibprocessing.attributevalues;
-
-import java.util.List;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Meta-data processing type representing a long attribute value runtime type
- * that implements IValidValues, IDefaultValue, IValidELValues
- *
- * <p><b>Provisional API - subject to change</b></p>
- * @author Gerry Kessler - Oracle
- */
-public class LongType extends NumberType {
- private static final String INVALID_LONG = Messages.LongType_invalid_long;
-
- /* (non-Javadoc)
- * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType()
- */
- protected String getReturnType(){ return "long";} //$NON-NLS-1$
-
- /**
- * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values
- * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String)
- **/
- public boolean isValidValue(String value) {
- try {
- Long aLong = Long.valueOf(value);
- exceedsMaxValue(aLong.longValue());
- lessThanMinValue(aLong.longValue());
- if (!(minFound || maxFound)){
- List validVals = getMDValidValues();
- if (!validVals.isEmpty()){
- if (!validVals.contains(value)){
- addNewValidationMessage(Messages.LongType_invalid_member);
- }
- }
- }
- return getValidationMessages().isEmpty();
- } catch (NumberFormatException e) {
- addNewValidationMessage(INVALID_LONG);
- return false;
- }
-
- }
-
- private void exceedsMaxValue(long aLong) {
- String strMax = getValidMaximumValue();
- if (strMax != null){
- try {
- long max = Long.valueOf(strMax).longValue();
- maxFound = true;
- if (aLong > max){
- addNewValidationMessage(NLS.bind(EXCEEDS_MAX, strMax));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
- private void lessThanMinValue(long aLong) {
- String strMin = getValidMinimumValue();
- if (strMin != null){
- try {
- long min = Long.valueOf(strMin).longValue();
- minFound = true;
- if (aLong < min){
- addNewValidationMessage(NLS.bind(LESS_THAN_MIN, strMin));
- }
- } catch (NumberFormatException e) {
- //TODO: ignore error???? or log it????
- }
- }
-
- }
-
-}

Back to the top