You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2004/05/30 20:35:06 UTC
cvs commit: incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor BooleanEditor.java ByteEditor.java CharacterEditor.java DoubleEditor.java FloatEditor.java IntegerEditor.java LongEditor.java ShortEditor.java
djencks 2004/05/30 11:35:06
Added: modules/common/src/java/org/apache/geronimo/common/propertyeditor
BooleanEditor.java ByteEditor.java
CharacterEditor.java DoubleEditor.java
FloatEditor.java IntegerEditor.java LongEditor.java
ShortEditor.java
Log:
Property editors needed by connectors. Hard to believe these aren't supplied.
Revision Changes Path
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/BooleanEditor.java
Index: BooleanEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class BooleanEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
return Boolean.valueOf(text);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/ByteEditor.java
Index: ByteEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class ByteEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
return Byte.valueOf(text);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/CharacterEditor.java
Index: CharacterEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class CharacterEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
if (text.length() != 1) {
throw new IllegalArgumentException("wrong size: " + text);
}
return new Character(text.toCharArray()[0]);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/DoubleEditor.java
Index: DoubleEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class DoubleEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
return Double.valueOf(text);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/FloatEditor.java
Index: FloatEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class FloatEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
return Float.valueOf(text);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/IntegerEditor.java
Index: IntegerEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class IntegerEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
return Integer.valueOf(text);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/LongEditor.java
Index: LongEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class LongEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
return Long.valueOf(text);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}
1.1 incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/propertyeditor/ShortEditor.java
Index: ShortEditor.java
===================================================================
/**
*
* Copyright 2004 The Apache Software Foundation
*
* Licensed 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.geronimo.common.propertyeditor;
/**
*
*
* @version $Revision: 1.1 $ $Date: 2004/05/30 18:35:06 $
*
* */
public class ShortEditor extends TextPropertyEditorSupport {
public Object getValue()
{
try {
String text = getAsText();
return Short.valueOf(text);
}
catch (Exception e) {
throw new PropertyEditorException(e);
}
}
}