Package name.abuchen.portfolio.model

Examples of name.abuchen.portfolio.model.Attributes


    }

    @Override
    public Object getValue(Object element) throws Exception
    {
        Attributes attribs = Adaptor.adapt(Attributable.class, element).getAttributes();
        return attribute.getConverter().toString(attribs.get(attribute));
    }
View Full Code Here


    }

    @Override
    public void setValue(Object element, Object value) throws Exception
    {
        Attributes attribs = Adaptor.adapt(Attributable.class, element).getAttributes();

        Object newValue = attribute.getConverter().fromString(String.valueOf(value));
        Object oldValue = attribs.get(attribute);

        // update the value
        // * if it has non null value and the value actually changed
        // * or if it is null and previously existed

        if ((newValue != null && !newValue.equals(oldValue)) //
                        || (newValue == null && attribs.exists(attribute)))
        {
            attribs.put(attribute, newValue);
            notify(element, newValue, oldValue);
        }
    }
View Full Code Here

        this.isRetired = security.isRetired();

        for (Taxonomy taxonomy : client.getTaxonomies())
            this.taxonomies.add(new TaxonomyDesignation(taxonomy, security));

        Attributes a = security.getAttributes();
        for (AttributeType attributeType : AttributeTypes.available(Security.class))
        {
            if (a.exists(attributeType))
            {
                AttributeDesignation designation = new AttributeDesignation(attributeType, a.get(attributeType));
                attributes.add(designation);
            }
        }
    }
View Full Code Here

        security.setRetired(isRetired);

        for (TaxonomyDesignation designation : taxonomies)
            designation.applyChanges();

        Attributes a = new Attributes();
        for (AttributeDesignation attribute : attributes)
            a.put(attribute.getType(), attribute.getValue());
        security.setAttributes(a);
    }
View Full Code Here

        {
            Attributable attributable = Adaptor.adapt(Attributable.class, element);
            if (attributable == null)
                return null;

            Attributes attributes = attributable.getAttributes();

            Object value = attributes.get(attribute);
            return attribute.getConverter().toString(value);
        }
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.model.Attributes

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.