Package org.apache.hivemind.schema

Examples of org.apache.hivemind.schema.AttributeModel


        assertEquals(0, em.getElementModel().size());

        List al = em.getAttributeModels();
        assertEquals(2, al.size());

        AttributeModel am = (AttributeModel) al.get(0);
        assertEquals("bar", am.getName());
        assertEquals(true, am.isRequired());

        am = (AttributeModel) al.get(1);
        assertEquals("biff", am.getName());

        em = (ElementModel) l.get(1);

        assertEquals("foo2", em.getElementName());
        assertEquals(2, em.getAttributeModels().size());
View Full Code Here


        element.appendChild(_document.createTextNode(em.getAnnotation()));

        for (Iterator i = em.getAttributeModels().iterator(); i.hasNext();)
        {
            AttributeModel am = (AttributeModel) i.next();

            Element attribute = getAttributeElement(am);

            element.appendChild(attribute);
        }
View Full Code Here

        assertEquals(0, em.getElementModel().size());

        List al = em.getAttributeModels();
        assertEquals(2, al.size());

        AttributeModel am = (AttributeModel) al.get(0);
        assertEquals("bar", am.getName());
        assertEquals(true, am.isRequired());

        am = (AttributeModel) al.get(1);
        assertEquals("biff", am.getName());
        assertEquals("glob", am.getDefault());

        em = (ElementModel) l.get(1);

        assertEquals("foo2", em.getElementName());
        assertEquals(2, em.getAttributeModels().size());
View Full Code Here

            if (keyAttribute == null) {
                // check for unique attribute
                for (Iterator j = _activeElement.getModel().getAttributeModels().iterator(); j.hasNext();)
                {
                    AttributeModel attributeModel = (AttributeModel) j.next();
   
                    if (attributeModel.isUnique())
                        keyAttribute = attributeModel.getName();
                }
            }

            String expandedKey = getSymbolExpander().expandSymbols(
                    currentElement.getAttributeValue(keyAttribute),
View Full Code Here

        List attributeModels = model.getAttributeModels();
        int count = attributeModels.size();

        for (int i = 0; i < count; i++)
        {
            AttributeModel am = (AttributeModel) attributeModels.get(i);

            String name = am.getName();

            _knownAttributes.add(name);

            if (am.isRequired())
                _requiredAttributes.add(name);

            // If the attribute should be unique, add a map for that attribute
            // to track unique values for that attribute.

            if (am.isUnique())
                _attributeValues.put(name, new HashMap());

            if (am.getDefault() != null)
                _attributeDefaults.put(am.getName(), am.getDefault());

            _attributeTranslators.put(name, am.getTranslator());
        }
    }
View Full Code Here

        if (_attributeModels == null)
            return null;

        for (Iterator i = _attributeModels.iterator(); i.hasNext();)
        {
            AttributeModel am = (AttributeModel) i.next();

            if (am.getName().equals(name))
                return am;
        }

        return null;
    }
View Full Code Here

                result = true;
           
            // check for unique attribute
            for (Iterator j = model.getAttributeModels().iterator(); j.hasNext();)
            {
                AttributeModel attributeModel = (AttributeModel) j.next();

                if (attributeModel.isUnique())
                    result = true;
            }
        }

        return result;
View Full Code Here

            ElementModel model = (ElementModel) i.next();

            // check for unique attribute
            for (Iterator j = model.getAttributeModels().iterator(); j.hasNext();)
            {
                AttributeModel attributeModel = (AttributeModel) j.next();

                if (attributeModel.isUnique())
                    result = true;
            }
        }

        return result;
View Full Code Here

            String key = em.getKeyAttribute();

            if (key == null)
                continue;

            AttributeModel keyAm = em.getAttributeModel(key);

            if (keyAm == null)
                throw new ApplicationRuntimeException("Key attribute \'" + key + "\' of element \'"
                        + em.getElementName() + "\' never declared.", em.getLocation(), null);
        }
View Full Code Here

    {
        Iterator i = _elementModel.getAttributeModels().iterator();

        while (i.hasNext())
        {
            AttributeModel am = (AttributeModel) i.next();
            String attributeName = am.getName();

            AttributeMappingDescriptor amd = (AttributeMappingDescriptor) _attributeNameMappingMap
                    .get(attributeName);

            if (amd == null)
View Full Code Here

TOP

Related Classes of org.apache.hivemind.schema.AttributeModel

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.