Package com.volantis.mcs.build.themes.definitions.values.impl

Examples of com.volantis.mcs.build.themes.definitions.values.impl.SingleValueContainer


    }

    private void processInitialValue(Element element) {

        // Create a container to hold the initial value.
        SingleValueContainer container = new SingleValueContainer();
        pushObject(container);

        // Create a container for a property reference.
        PropertyReference reference = new PropertyReference();
        pushObject(reference);

        // Create a container for a computed reference.
        ComputedReference computedRef = new ComputedReference();
        pushObject(computedRef);

        // Process the children.
        processThemePropertyChildren(element);

        popObject();
        popObject();
        popObject();

        String computedPropertyRef = computedRef.getPropertyName();
        String propertyReference = reference.getPropertyName();
        Value initialValue = container.getValue();

        if ((propertyReference != null   && initialValue != null) ||
            (propertyReference != null   && computedPropertyRef != null) ||
            (computedPropertyRef != null && initialValue != null)) {
            throw new IllegalStateException(
                    "Only a property reference, computed reference" +
                        " or an initial value are allowed, not both");
        }

        Property property = (Property) findObject(Property.class);
        ValueSource source;
        if (initialValue != null) {
            source = new FixedValueSource(container.getValue());
            property.setInitialValue(container.getValue());
        } else if (propertyReference != null) {
            source = new PropertyValueSource(propertyReference);
        } else if (computedPropertyRef != null) {
            source = new ComputedValueSource(
                computedPropertyRef, computedRef.getRules());
View Full Code Here

TOP

Related Classes of com.volantis.mcs.build.themes.definitions.values.impl.SingleValueContainer

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.