Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.DynaProperty


     */
    public String toString() {

        StringBuffer sb = new StringBuffer("DynaActionForm[dynaClass=");
        sb.append(getDynaClass().getName());
        DynaProperty props[] = getDynaClass().getDynaProperties();
        if (props == null) {
            props = new DynaProperty[0];
        }
        for (int i = 0; i < props.length; i++) {
            sb.append(',');
View Full Code Here


     * @exception IllegalArgumentException if this is not a valid property
     *  name for our DynaClass
     */
    protected DynaProperty getDynaProperty(String name) {

        DynaProperty descriptor = getDynaClass().getDynaProperty(name);
        if (descriptor == null) {
            throw new IllegalArgumentException
                ("Invalid property name '" + name + "'");
        }
        return (descriptor);
View Full Code Here

        assertExpression("${dbean.intProperty}", new Integer(24));
    }

  protected DynaClass createDynaClass() {
    DynaProperty[] properties = {
      new DynaProperty("booleanProperty", Boolean.TYPE),
      new DynaProperty("booleanSecond", Boolean.TYPE),
      new DynaProperty("doubleProperty", Double.TYPE),
      new DynaProperty("floatProperty", Float.TYPE),
      new DynaProperty("intProperty", Integer.TYPE),
      new DynaProperty("listIndexed", List.class),
      new DynaProperty("longProperty", Long.TYPE),
      new DynaProperty("mappedProperty", Map.class),
      new DynaProperty("mappedIntProperty", Map.class),
      new DynaProperty("nullProperty", String.class),
      new DynaProperty("shortProperty", Short.TYPE),
      new DynaProperty("stringProperty", String.class),
    };
        return new BasicDynaClass("TestDynaClass", null, properties);
    }
View Full Code Here

   
    private DynaClass createDynasaurClass() throws Exception {
        DynaClass dynaClass = new BasicDynaClass
                ("Dynasaur", null,
                        new DynaProperty[]{
                            new DynaProperty("Species", String.class),
                            new DynaProperty("isRaptor", Boolean.TYPE),
                            new DynaProperty("Period", String.class),
                        });
        return (dynaClass);
    }
View Full Code Here

    }
   
    public DynaClass getDynaClass() {
        return new DynaClass() {
            public DynaProperty[] getDynaProperties() {
                DynaProperty[] properties = {new DynaProperty("DynaProp", String.class)};
                return properties;
            }
           
            public String getName() {
                return "DynaWithDotBetwixtClass";
            }
           
            public DynaBean newInstance() {
                return new DynaWithDotBetwixt();
            }
           
            public DynaProperty getDynaProperty(String name) {
                if ("DynaProp".equals(name)) {
                    return new DynaProperty("DynaProp", String.class);
                }
                return null;
            }  
        };
    }
View Full Code Here

     */
    public String toString() {

        StringBuffer sb = new StringBuffer("DynaActionFormBean[name=");
        sb.append(name);
        DynaProperty props[] = getDynaProperties();
        if (props == null) {
            props = new DynaProperty[0];
        }
        for (int i = 0; i < props.length; i++) {
            sb.append(',');
View Full Code Here

        // Create corresponding dynamic property definitions
        properties = new DynaProperty[descriptors.length];
        for (int i = 0; i < descriptors.length; i++) {
            properties[i] =
                new DynaProperty(descriptors[i].getName(),
                                 descriptors[i].getTypeClass());
            propertiesMap.put(properties[i].getName(),
                              properties[i]);
        }
View Full Code Here

     * @exception IllegalArgumentException if there is no property
     *  of the specified name
     */
    public boolean contains(String name, String key) {

        DynaProperty descriptor = getDynaProperty(name);
        Object value = dynaValues.get(name);
        if (value == null) {
            throw new NullPointerException
                ("No mapped value for '" + name + "(" + key + ")'");
        } else if (value instanceof Map) {
View Full Code Here

     * @exception NullPointerException if no array or List has been
     *  initialized for this property
     */
    public Object get(String name, int index) {

        DynaProperty descriptor = getDynaProperty(name);
        Object value = dynaValues.get(name);
        if (value == null) {
            throw new NullPointerException
                ("No indexed value for '" + name + "[" + index + "]'");
        } else if (value.getClass().isArray()) {
View Full Code Here

     * @exception IllegalArgumentException if the specified property
     *  exists, but is not mapped
     */
    public Object get(String name, String key) {

        DynaProperty descriptor = getDynaProperty(name);
        Object value = dynaValues.get(name);
        if (value == null) {
            throw new NullPointerException
                ("No mapped value for '" + name + "(" + key + ")'");
        } else if (value instanceof Map) {
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.DynaProperty

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.