All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.milyn.javabean.gen.model.ClassConfig Maven / Gradle / Ivy

The newest version!
/*
	Milyn - Copyright (C) 2006 - 2010

	This library is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public
	License (version 2.1) as published by the Free Software
	Foundation.

	This library is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

	See the GNU Lesser General Public License for more details:
	http://www.gnu.org/licenses/lgpl.txt
*/
package org.milyn.javabean.gen.model;

import org.milyn.javabean.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author [email protected]
 */
public class ClassConfig {

    private Class beanClass;
    private String beanId;
    private List bindings = new ArrayList();
    private boolean isArray;

    public ClassConfig(Class beanClass) {
        this.beanClass = beanClass;
    }

    public ClassConfig(Class beanClass, String beanId) {
        this.beanClass = beanClass;
        this.beanId = beanId;
    }

    public Class getBeanClass() {
        return beanClass;
    }

    public List getBindings() {
        return bindings;
    }

    public void setBindings(List bindings) {
        this.bindings = bindings;
    }

    public boolean isArray() {
        return isArray;
    }

    public void setArray(boolean array) {
        isArray = array;
    }

    public String getBeanId() {
        if(beanId != null) {
            return beanId;
        } else {
            StringBuilder beanId = new StringBuilder(beanClass.getSimpleName());
            beanId.setCharAt(0, Character.toLowerCase(beanId.charAt(0)));
            return beanId.toString();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy