Package org.osgi.service.component

Examples of org.osgi.service.component.ComponentException


        }
        if (type == String.class)
        {
            return coerceToString(raw);
        }
        throw new ComponentException ("unexpected output type " + type);
    }
View Full Code Here


            {
                return Byte.parseByte( (String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: byte0;
        }
        if (o instanceof Character)
        {
            return ( byte ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).byteValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
                return Double.parseDouble((String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: 0;
        }
        if (o instanceof Character)
        {
            return ( double ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).doubleValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
                return Float.parseFloat((String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: 0;
        }
        if (o instanceof Character)
        {
            return ( float ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).floatValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
                return Integer.parseInt( (String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: 0;
        }
        if (o instanceof Character)
        {
            return ( int ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).intValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
                return Long.parseLong( (String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: 0;
        }
        if (o instanceof Character)
        {
            return ( long ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).longValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
                return Short.parseShort( (String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Boolean)
        {
            return (Boolean)o? 1: short0;
        }
        if (o instanceof Character)
        {
            return ( short ) ((Character)o).charValue();
        }
        if (o instanceof Number)
        {
            return ((Number)o).shortValue();
        }
        if (o == null)
        {
            return 0;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
                return Boolean.parseBoolean( (String)o );
            }
            catch ( NumberFormatException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o instanceof Character)
        {
            return ((Character)o).charValue() != 0;
        }
        if (o instanceof Number)
        {
            return ((Number)o).intValue() != 0;
        }
        if (o == null)
        {
            return false;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
                return b.loadClass( (String)o );
            }
            catch ( ClassNotFoundException e )
            {
                throw new ComponentException(e);
            }
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

            {
            return Enum.valueOf( clazz, (String)o );
            }
            catch ( IllegalArgumentException e )
            {
                throw new ComponentException(e);
            }
        }
        if (o == null)
        {
            return null;
        }
        throw new ComponentException( "Unrecognized input type: " + o);
    }
View Full Code Here

TOP

Related Classes of org.osgi.service.component.ComponentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.