Package com.volantis.shared.metadata.value

Examples of com.volantis.shared.metadata.value.MetaDataValue


        // check the created object
        final List enumeratedValues =
            string.getEnumeratedConstraint().getEnumeratedValues();
        assertEquals(2, enumeratedValues.size());
        final MetaDataValue first = (MetaDataValue) enumeratedValues.get(0);
        assertTrue(first instanceof StringValue);
        assertEquals("foo", first.getAsString());
        final MetaDataValue second = (MetaDataValue) enumeratedValues.get(1);
        assertEquals("bar", second.getAsString());
        assertTrue(second instanceof StringValue);

        final Object otherString = doRoundTrip(string);
        assertEquals(string, otherString);
    }
View Full Code Here


            if (memberTypeConstraint != null) {
                final MetaDataTypeImpl memberType =
                    (MetaDataTypeImpl) memberTypeConstraint.getMemberType();
                final Iterator iter = contents.iterator();
                for (int i = 1; iter.hasNext(); i++) {
                    final MetaDataValue child = (MetaDataValue) iter.next();
                    final String childPath = path + "[" + i + "]";
                    final Collection childErrors =
                        memberType.verify(child, childPath);
                    if (childErrors.size() > 0) {
                        errors.add(new VerificationError(
View Full Code Here

            if (uniqueMemberConstraint != null) {
                final ListValue list = (ListValue) value;
                final Set values = new HashSet();
                final Iterator iter = list.getContentsAsList().iterator();
                for (int i = 1; iter.hasNext(); i++) {
                    final MetaDataValue child = (MetaDataValue) iter.next();
                    if (!values.add(child)) {
                        errors.add(new VerificationError(
                            VerificationError.TYPE_CONSTRAINT_VIOLATION,
                            path + "[" + i + "]", child, uniqueMemberConstraint,
                            "Unique member constraint violation."));
View Full Code Here

        } else {
            StringBuffer buffer = new StringBuffer();
            for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
                Map.Entry entry = (Map.Entry) i.next();
                String key = (String) entry.getKey();
                MetaDataValue value = (MetaDataValue) entry.getValue();
                if (value != null) {
                    if (buffer.length() != 0) {
                        buffer.append(" ");
                    }
                    buffer.append("[");
                    buffer.append(key);
                    buffer.append("=");
                    buffer.append(value.getAsString());
                    buffer.append("]");
                }
            }
            s = buffer.toString();
        }
View Full Code Here

        if (collection.isEmpty()) {
            s = "";
        } else {
            StringBuffer buffer = new StringBuffer();
            for (Iterator i = collection.iterator(); i.hasNext();) {
                MetaDataValue value = (MetaDataValue) i.next();
                if (buffer.length() != 0) {
                    buffer.append(" ");
                }
                buffer.append(value.getAsString());
            }
            s = buffer.toString();
        }

        return s;
View Full Code Here

            for (Iterator iter = fields.iterator(); iter.hasNext(); ) {
                final FieldDefinition fieldDef = (FieldDefinition) iter.next();
                final String fieldName = fieldDef.getName();
                final MetaDataTypeImpl fieldType =
                    (MetaDataTypeImpl) fieldDef.getType();
                final MetaDataValue fieldValue =
                    (MetaDataValue) fieldValues.get(fieldName);
                errors.addAll(
                    fieldType.verify(fieldValue, path + "/" + fieldName));
                remainingFields.remove(fieldName);
            }
View Full Code Here

        Value result = defaultValue;
        ServiceDefinition service = getServiceDefinition(expressionContext);
        if (service != null) {
            try {
                MetaDataValue value = service.getCharacteristic(name);
                result = createValue(expressionContext.getFactory(), value);
            } catch (CharacteristicNotAvailableException e) {
                // log the error but we still return the defaultValue
                logger.warn("get-characteristics-fn-failed",
                            new String[] {getFunctionName(), name},
View Full Code Here

TOP

Related Classes of com.volantis.shared.metadata.value.MetaDataValue

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.