// Path: modules/api/src/main/java/javax/el/ELException.java
// public class ELException extends RuntimeException {
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * Creates an ELException with no detail message.
// 	 */
// 	public ELException() {
// 		super();
// 	}
// 
// 	/**
// 	 * Creates an ELException with the provided detail message.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 */
// 	public ELException(String message) {
// 		super(message);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given cause.
// 	 * 
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(Throwable cause) {
// 		super(cause);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given detail message and root cause.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


import java.beans.PropertyEditor;
import java.beans.PropertyEditorManager;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.el.ELException;

/*
 * Copyright 2006-2009 Odysseus Software GmbH
 *
 * 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 de.odysseus.el.misc;



/**
 * Type Conversions as described in EL 2.1 specification (section 1.17).
 */
public class TypeConverterImpl implements TypeConverter {
	private static final long serialVersionUID = 1L;

	protected Boolean coerceToBoolean(Object value) {
		if (value == null || "".equals(value)) {
			return Boolean.FALSE;
		}
		if (value instanceof Boolean) {
			return (Boolean)value;
		}
		if (value instanceof String) {
			return Boolean.valueOf((String)value);
		}

// Path: modules/api/src/main/java/javax/el/ELException.java
// public class ELException extends RuntimeException {
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * Creates an ELException with no detail message.
// 	 */
// 	public ELException() {
// 		super();
// 	}
// 
// 	/**
// 	 * Creates an ELException with the provided detail message.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 */
// 	public ELException(String message) {
// 		super(message);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given cause.
// 	 * 
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(Throwable cause) {
// 		super(cause);
// 	}
// 
// 	/**
// 	 * Creates an ELException with the given detail message and root cause.
// 	 * 
// 	 * @param message
// 	 *            the detail message
// 	 * @param cause
// 	 *            the originating cause of this exception
// 	 */
// 	public ELException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


// Path: modules/impl/src/main/java/de/odysseus/el/misc/TypeConverterImpl.java
import java.beans.PropertyEditor;
import java.beans.PropertyEditorManager;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.el.ELException;

/*
 * Copyright 2006-2009 Odysseus Software GmbH
 *
 * 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 de.odysseus.el.misc;



/**
 * Type Conversions as described in EL 2.1 specification (section 1.17).
 */
public class TypeConverterImpl implements TypeConverter {
	private static final long serialVersionUID = 1L;

	protected Boolean coerceToBoolean(Object value) {
		if (value == null || "".equals(value)) {
			return Boolean.FALSE;
		}
		if (value instanceof Boolean) {
			return (Boolean)value;
		}
		if (value instanceof String) {
			return Boolean.valueOf((String)value);
		}

		throw new ELException(LocalMessages.get("error.coerce.type", value.getClass(), Boolean.class));
