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

com.jpattern.ioc.xml.BeanContext Maven / Gradle / Ivy

There is a newer version: 2.7.1
Show newest version
package com.jpattern.ioc.xml;

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

/**
 * @author Claudio Quaresima - [email protected] - 23/ott/08 17:53:34
 * @version $Id: $
 */
public class BeanContext {

    private List entries = new ArrayList();
    private List parameters = new ArrayList();

    public BeanContext(Id aId, ClassName aClassName) {

        id = aId;
        classname = aClassName;
    }

    public void add(IEntry aEntry) {
        entries.add(aEntry);
    }
    
    public void add(IParameter aParameter) {
        parameters.add(aParameter);
    }


    private Id id;

    private ClassName classname;

    public Id getId() {
        return id;
    }

    public ClassName getClassname() {
        return classname;
    }

    public List getEntries() {
        if (entries == null)
            entries = new ArrayList();
        return entries;
    }
    
    public List getParameters() {
        if (parameters == null)
        	parameters = new ArrayList();
        return parameters;
    }

    /*
     * public boolean containsEntryProperty(String properyName) { ListIterator liter = getEntries().listIterator(); IEntry iEntry ; Key key; while
     * (liter.hasNext()) { iEntry = (IEntry)liter.next(); key= iEntry.getKey(); if (properyName.equals(key.key())) return true; } return false; }
     */
    
    
    public boolean containsEntryProperty(String properyName) {
        return getEntries().contains(new Entry(new Key(properyName), null));
    }
    
    public int hashCode() {
        return id.hashCode();
    }

    public boolean equals(Object obj) {
        if ( !(obj instanceof BeanContext))
                return false;
        final BeanContext other = (BeanContext) obj;
        return id.equals(other.id);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy