Package org.apache.chemistry.opencmis.commons.impl.dataobjects

Examples of org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl


        if (source instanceof PropertyStringDefinition) {
            PropertyStringDefinition def = (PropertyStringDefinition) source;

            if (def.getDefaultValue() != null) {
                writeProperty(writer, new PropertyStringImpl(null, def.getDefaultValue()), true);
            }

            XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_PROPERTY_TYPE_MAX_LENGTH, def.getMaxLength());
        } else if (source instanceof PropertyIdDefinition) {
            PropertyIdDefinition def = (PropertyIdDefinition) source;
View Full Code Here


                    values = Collections.singletonList(value);
                }

                switch (propertyType) {
                case STRING:
                    property = new PropertyStringImpl();
                    ((PropertyStringImpl) property).setValues(copyStringValues(values));
                    break;
                case ID:
                    property = new PropertyIdImpl();
                    ((PropertyIdImpl) property).setValues(copyStringValues(values));
View Full Code Here

            AbstractPropertyData<?> property = null;

            if (propDef != null) {
                switch (propDef.getPropertyType()) {
                case STRING:
                    property = new PropertyStringImpl();
                    ((PropertyStringImpl) property).setValues(copyStringValues(values));
                    break;
                case ID:
                    property = new PropertyIdImpl();
                    ((PropertyIdImpl) property).setValues(copyStringValues(values));
                    break;
                case BOOLEAN:
                    property = new PropertyBooleanImpl();
                    ((PropertyBooleanImpl) property).setValues(copyBooleanValues(values));
                    break;
                case INTEGER:
                    property = new PropertyIntegerImpl();
                    ((PropertyIntegerImpl) property).setValues(copyIntegerValues(values));
                    break;
                case DECIMAL:
                    property = new PropertyDecimalImpl();
                    ((PropertyDecimalImpl) property).setValues(copyDecimalValues(values));
                    break;
                case DATETIME:
                    property = new PropertyDateTimeImpl();
                    ((PropertyDateTimeImpl) property).setValues(copyDateTimeValues(values));
                    break;
                case HTML:
                    property = new PropertyHtmlImpl();
                    ((PropertyHtmlImpl) property).setValues(copyStringValues(values));
                    break;
                case URI:
                    property = new PropertyUriImpl();
                    ((PropertyUriImpl) property).setValues(copyStringValues(values));
                    break;
                default:
                    throw new CmisRuntimeException("Unknown property type!");
                }

                property.setId(id);
                property.setDisplayName(propDef.getDisplayName());
                property.setQueryName(propDef.getQueryName());
                property.setLocalName(propDef.getLocalName());
            } else {
                // this else block should only be reached in rare circumstances
                // it may return incorrect types

                if (values == null) {
                    property = new PropertyStringImpl();
                    ((PropertyStringImpl) property).setValues(null);
                } else {
                    Object firstValue = values.get(0);
                    if (firstValue instanceof Boolean) {
                        property = new PropertyBooleanImpl();
                        ((PropertyBooleanImpl) property).setValues(copyBooleanValues(values));
                    } else if (firstValue instanceof BigInteger) {
                        property = new PropertyIntegerImpl();
                        ((PropertyIntegerImpl) property).setValues(copyIntegerValues(values));
                    } else if (firstValue instanceof BigDecimal) {
                        property = new PropertyDecimalImpl();
                        ((PropertyDecimalImpl) property).setValues(copyDecimalValues(values));
                    } else {
                        property = new PropertyStringImpl();
                        ((PropertyStringImpl) property).setValues(copyStringValues(values));
                    }
                }

                property.setId(id);
View Full Code Here

        }

        PropertyData<?> result = null;

        if (property instanceof CmisPropertyString) {
            result = new PropertyStringImpl(property.getPropertyDefinitionId(),
                    ((CmisPropertyString) property).getValue());
        } else if (property instanceof CmisPropertyId) {
            result = new PropertyIdImpl(property.getPropertyDefinitionId(), ((CmisPropertyId) property).getValue());
        } else if (property instanceof CmisPropertyInteger) {
            result = new PropertyIntegerImpl(property.getPropertyDefinitionId(),
View Full Code Here

        }

        PropertyData<?> result = null;

        if (property instanceof CmisPropertyString) {
            result = new PropertyStringImpl(property.getPropertyDefinitionId(),
                    ((CmisPropertyString) property).getValue());
        } else if (property instanceof CmisPropertyId) {
            result = new PropertyIdImpl(property.getPropertyDefinitionId(), ((CmisPropertyId) property).getValue());
        } else if (property instanceof CmisPropertyInteger) {
            result = new PropertyIntegerImpl(property.getPropertyDefinitionId(),
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyStringImpl

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.