Package com.volantis.shared.metadata.value.mutable

Examples of com.volantis.shared.metadata.value.mutable.MutableStringValue


        return value;
    }

    // Javadoc inherited
    public ImmutableMetaDataValue createMetaDataValue() {
        MutableStringValue stringValue = VALUE_FACTORY.createStringValue();
        stringValue.setValue(value);

        return (ImmutableMetaDataValue) stringValue.createImmutable();
    }
View Full Code Here


        return getAsString();
    }

    // Javadoc inherited
    public ImmutableMetaDataValue createMetaDataValue() {
        MutableStringValue stringValue = VALUE_FACTORY.createStringValue();
        stringValue.setValue(value);

        return (ImmutableMetaDataValue) stringValue.createImmutable();
    }
View Full Code Here

                META_DATA_VALUE_FACTORY.createStructureValue();


        Map subMap = subStructure.getFieldValuesAsMutableMap();

        MutableStringValue aString = mdvFactory.createStringValue();
        aString.setValue("a-string");
        subMap.put("keyA", aString);

        MutableNumberValue eleven = mdvFactory.createNumberValue();
        eleven.setValue(new Integer(11));
        subMap.put("keyB", eleven);

        topMap.put("key1", subStructure.createImmutable());

        // create the
        // key2[0]/true
        //     [1]/false
        //
        // part
        MutableListValue metaList = META_DATA_VALUE_FACTORY.createListValue();
        List list = metaList.getContentsAsMutableList();

        MutableBooleanValue trueBool =
                META_DATA_VALUE_FACTORY.createBooleanValue();
        trueBool.setValue(Boolean.TRUE);
        list.add(trueBool);

        MutableBooleanValue falseBool =
                META_DATA_VALUE_FACTORY.createBooleanValue();
        falseBool.setValue(Boolean.FALSE);
        list.add(falseBool);

        topMap.put("key2", metaList.createImmutable());

        // create the
        // key3/set[0]/keyX/b-string
        //            /keyY/c-string
        //     /set[1]/true
        //     /set[2]/x-string
        MutableSetValue metaSet = META_DATA_VALUE_FACTORY.createSetValue();
        Set set = metaSet.getContentsAsMutableSet();

        MutableStructureValue setsStruct =
                META_DATA_VALUE_FACTORY.createStructureValue();

        Map setsStructMap = setsStruct.getFieldValuesAsMutableMap();
        MutableStringValue bString = mdvFactory.createStringValue();
        bString.setValue("b-string");
        setsStructMap.put("keyX", bString);

        MutableStringValue cString = mdvFactory.createStringValue();
        cString.setValue("c-string");
        setsStructMap.put("keyY", cString);

        set.add(setsStruct.createImmutable());


        MutableBooleanValue tBool =
                META_DATA_VALUE_FACTORY.createBooleanValue();
        tBool.setValue(Boolean.TRUE);
        set.add(tBool);

        MutableStringValue xString = mdvFactory.createStringValue();
        xString.setValue("x-string");
        set.add(xString);

        topMap.put("key3", metaSet.createImmutable());
        // create the
        //
        // key4/z-string
        //
        // part
        MutableStringValue zString = mdvFactory.createStringValue();
        zString.setValue("z-string");
        topMap.put("key4", zString);

        return (ImmutableStructureValue) structure.createImmutable();
    }
View Full Code Here

                = CONSTRAINT_FACTORY.createEnumeratedConstraint();
        List allowableValues = enumeratedConstraint.getMutableEnumeratedValues();

        for (Iterator i = keywords.iterator(); i.hasNext();) {
            String keyword = (String) i.next();
            MutableStringValue value = VALUE_FACTORY.createStringValue();
            value.setValue(keyword);
            allowableValues.add(value);
        }

        // Add the constraint.
        stringType.setEnumeratedConstraint(enumeratedConstraint);
View Full Code Here

     * @throws Exception if an error occurs
     */
    public void testWhenCharacteristicIsStr() throws Exception {
        // add a policy/policy value pair to the request
        String charateristic = "string";
        MutableStringValue value = META_DATA_VALUE_FACTORY.createStringValue();
        value.setValue("a_string");
        ImmutableMetaDataValue stringVal = (ImmutableMetaDataValue)
                                              value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(stringVal);

        // invoke the function
        Expression expression = parser.parse(getFunctionQName() +
View Full Code Here

    public void testWhenCharacteristicIsList() throws Exception {
        // add a policy/policy value pair to the request
        String charateristic = "list";
        MutableListValue value = META_DATA_VALUE_FACTORY.createListValue();
        List list = value.getContentsAsMutableList();
        MutableStringValue strVal = META_DATA_VALUE_FACTORY.createStringValue();
        strVal.setValue("str");
        list.add(strVal.createImmutable());
        ImmutableMetaDataValue listVal = (ImmutableMetaDataValue)
                                              value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(listVal);
View Full Code Here

    public void testWhenCharacteristicIsSet() throws Exception {
        // add a policy/policy value pair to the request
        String charateristic = "set";
        MutableSetValue value = META_DATA_VALUE_FACTORY.createSetValue();
        Set set = value.getContentsAsMutableSet();
        MutableStringValue strVal = META_DATA_VALUE_FACTORY.createStringValue();
        strVal.setValue("str");
        set.add(strVal.createImmutable());
        ImmutableMetaDataValue setVal = (ImmutableMetaDataValue)
                                              value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(setVal);
View Full Code Here

        // add a policy/policy value pair to the request
        String charateristic = "struct";
        MutableStructureValue value =
                META_DATA_VALUE_FACTORY.createStructureValue();
        Map map = value.getFieldValuesAsMutableMap();
        MutableStringValue strVal = META_DATA_VALUE_FACTORY.createStringValue();
        strVal.setValue("str");
        map.put("key", strVal.createImmutable());
        ImmutableMetaDataValue structVal = (ImmutableMetaDataValue)
                                                 value.createImmutable();

        serviceDefMock.expects.getCharacteristic(charateristic).returns(structVal);
View Full Code Here

            unmarshall(getResourceAsString("res/structure-with-strings.xml"),
               ImmutableStructureValueImpl.class);

        // check the created object
        final Map expectedFields = new HashMap();
        MutableStringValue value = new MutableStringValueImpl();
        value.setValue("First Value");
        expectedFields.put("first", value.createImmutable());
        value.setValue("Second Value");
        expectedFields.put("second", value.createImmutable());
        assertEquals(expectedFields, structure.getFieldValuesAsMap());

        final Object otherStructure = doRoundTrip(structure);
        assertEquals(structure, otherStructure);
    }
View Full Code Here

                getResourceAsString("res/structure-with-booleans-and-strings.xml"),
                ImmutableStructureValueImpl.class);

        // check the created object
        final Map expectedFields = new HashMap();
        MutableStringValue stringValue = new MutableStringValueImpl();
        stringValue.setValue("First Value");
        expectedFields.put("first", stringValue.createImmutable());
        stringValue.setValue("Fourth Value");
        expectedFields.put("fourth", stringValue.createImmutable());
        MutableBooleanValue booleanValue = new MutableBooleanValueImpl();
        booleanValue.setValue(Boolean.TRUE);
        expectedFields.put("second", booleanValue.createImmutable());
        booleanValue.setValue(Boolean.FALSE);
        expectedFields.put("third", booleanValue.createImmutable());
View Full Code Here

TOP

Related Classes of com.volantis.shared.metadata.value.mutable.MutableStringValue

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.