Search in sources :

Example 36 with Property

use of jp.ossc.nimbus.beans.Property in project nimbus by nimbus-org.

the class PropertyFactoryTest method testNestMap6_1.

public void testNestMap6_1() throws Exception {
    Property prop = PropertyFactory.createProperty("test.map.hogelist.[6].hoge72");
    Test test = new Test(new Test());
    assertEquals("fuga72", prop.getProperty(test));
    prop.setProperty(test, "hoge");
    assertEquals("hoge", prop.getProperty(test));
}
Also used : Property(jp.ossc.nimbus.beans.Property)

Example 37 with Property

use of jp.ossc.nimbus.beans.Property in project nimbus by nimbus-org.

the class PropertyFactoryTest method isError.

public boolean isError(String name) {
    boolean error = false;
    try {
        Property prop = PropertyFactory.createProperty(name);
        Test test = new Test();
        prop.getProperty(test);
    } catch (Exception e) {
        error = true;
    }
    return error;
}
Also used : Property(jp.ossc.nimbus.beans.Property)

Example 38 with Property

use of jp.ossc.nimbus.beans.Property in project nimbus by nimbus-org.

the class PropertyFactoryTest method test2Array.

public void test2Array() throws Exception {
    Property prop = PropertyFactory.createProperty("array2[0][0]");
    Test test = new Test();
    prop.setProperty(test, "hogehoge1");
    assertEquals("hogehoge1", prop.getProperty(test));
}
Also used : Property(jp.ossc.nimbus.beans.Property)

Example 39 with Property

use of jp.ossc.nimbus.beans.Property in project nimbus by nimbus-org.

the class WrappedClientConnectionFactoryService method getClientConnection.

public ClientConnection getClientConnection() throws ConnectionCreateException, RemoteException {
    if (getState() != STARTED) {
        throw new ConnectionCreateException("Service not started. name=" + getServiceNameObject());
    }
    try {
        ClientConnection clientConnection = (ClientConnection) clientConnectionWrapperConstructor.newInstance(new Object[] { clientConnectionFactory.getClientConnection() });
        if (properties != null) {
            final Iterator props = properties.keySet().iterator();
            while (props.hasNext()) {
                final Property prop = (Property) props.next();
                final Object val = properties.get(prop);
                prop.setProperty(clientConnection, val);
            }
        }
        return clientConnection;
    } catch (IllegalAccessException e) {
        throw new ConnectionCreateException(e);
    } catch (InstantiationException e) {
        throw new ConnectionCreateException(e);
    } catch (InvocationTargetException e) {
        throw new ConnectionCreateException(e);
    } catch (NoSuchPropertyException e) {
        throw new ConnectionCreateException(e);
    }
}
Also used : NoSuchPropertyException(jp.ossc.nimbus.beans.NoSuchPropertyException) Property(jp.ossc.nimbus.beans.Property) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 40 with Property

use of jp.ossc.nimbus.beans.Property in project nimbus by nimbus-org.

the class WrappedClientConnectionFactoryService method startService.

public void startService() throws Exception {
    if (clientConnectionFactory == null) {
        if (clientConnectionFactoryServiceName == null) {
            throw new IllegalArgumentException("ClientConnectionFactory is null.");
        }
        clientConnectionFactory = (ClientConnectionFactory) ServiceManagerFactory.getServiceObject(clientConnectionFactoryServiceName);
    }
    if (clientConnectionWrapperClass == null) {
        throw new IllegalArgumentException("ClientConnectionWrapperClass is null.");
    }
    try {
        clientConnectionWrapperConstructor = clientConnectionWrapperClass.getConstructor(new Class[] { ClientConnection.class });
    } catch (NoSuchMethodException e) {
        throw new IllegalArgumentException("Illegal ClientConnectionWrapperClass.", e);
    }
    if (wrapperProperties != null && wrapperProperties.size() != 0) {
        properties = new LinkedHashMap();
        final Iterator props = wrapperProperties.keySet().iterator();
        while (props.hasNext()) {
            final String propName = (String) props.next();
            final Object val = wrapperProperties.get(propName);
            final Property property = PropertyFactory.createProperty(propName);
            properties.put(property, val);
        }
    }
}
Also used : Property(jp.ossc.nimbus.beans.Property)

Aggregations

Property (jp.ossc.nimbus.beans.Property)48 NoSuchPropertyException (jp.ossc.nimbus.beans.NoSuchPropertyException)8 InvocationTargetException (java.lang.reflect.InvocationTargetException)7 Iterator (java.util.Iterator)5 Map (java.util.Map)5 HashMap (java.util.HashMap)4 DataSet (jp.ossc.nimbus.beans.dataset.DataSet)4 RecordList (jp.ossc.nimbus.beans.dataset.RecordList)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 NestedProperty (jp.ossc.nimbus.beans.NestedProperty)3 SimpleProperty (jp.ossc.nimbus.beans.SimpleProperty)3 Record (jp.ossc.nimbus.beans.dataset.Record)3 PropertyEditor (java.beans.PropertyEditor)2 BufferedReader (java.io.BufferedReader)2 SQLException (java.sql.SQLException)2 LinkedHashMap (java.util.LinkedHashMap)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 ParameterizedType (java.lang.reflect.ParameterizedType)1 Type (java.lang.reflect.Type)1