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

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


    private void addPropertyBoolean(PropertiesImpl props, String typeId, Set<String> filter, String id, boolean value) {
        if (!checkAddProperty(props, typeId, filter, id)) {
            return;
        }

        props.addProperty(new PropertyBooleanImpl(id, value));
    }
View Full Code Here


        List<?> defaultValue = propDef.getDefaultValue();
        if ((defaultValue != null) && (!defaultValue.isEmpty())) {
            switch (propDef.getPropertyType()) {
            case BOOLEAN:
                props.addProperty(new PropertyBooleanImpl(propDef.getId(), (List<Boolean>) defaultValue));
                break;
            case DATETIME:
                props.addProperty(new PropertyDateTimeImpl(propDef.getId(), (List<GregorianCalendar>) defaultValue));
                break;
            case DECIMAL:
View Full Code Here

                    boolValues.add(Boolean.valueOf(s));
                }
            } catch (NumberFormatException e) {
                throw new CmisInvalidArgumentException(propDef.getId() + " value is not a boolean value!");
            }
            propertyData = new PropertyBooleanImpl(propDef.getId(), boolValues);
            break;
        case INTEGER:
            List<BigInteger> intValues = new ArrayList<BigInteger>(strValues.size());
            try {
                for (String s : strValues) {
View Full Code Here

                    ((CmisPropertyInteger) property).getValue());
        } else if (property instanceof CmisPropertyDecimal) {
            result = new PropertyDecimalImpl(property.getPropertyDefinitionId(),
                    ((CmisPropertyDecimal) property).getValue());
        } else if (property instanceof CmisPropertyBoolean) {
            result = new PropertyBooleanImpl(property.getPropertyDefinitionId(),
                    ((CmisPropertyBoolean) property).getValue());
        } else if (property instanceof CmisPropertyDateTime) {
            result = new PropertyDateTimeImpl(property.getPropertyDefinitionId(),
                    convertXMLCalendar(((CmisPropertyDateTime) property).getValue()));
        } else if (property instanceof CmisPropertyHtml) {
View Full Code Here

    protected final void addPropertyBoolean(PropertiesImpl props, String typeId, Set<String> filter, String id, boolean value) {
        if (!checkAddProperty(props, typeId, filter, id)) {
            return;
        }

        PropertyBooleanImpl prop = new PropertyBooleanImpl(id, value);
        prop.setQueryName(id);
        props.addProperty(prop);
    }
View Full Code Here

            XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_PROPERTY_TYPE_MIN_VALUE, def.getMinValue());
        } else if (source instanceof PropertyBooleanDefinition) {
            PropertyBooleanDefinition def = (PropertyBooleanDefinition) source;

            if (def.getDefaultValue() != null) {
                writeProperty(writer, new PropertyBooleanImpl(null, def.getDefaultValue()), true);
            }
        } else if (source instanceof PropertyDateTimeDefinition) {
            PropertyDateTimeDefinition def = (PropertyDateTimeDefinition) source;

            if (def.getDefaultValue() != null) {
View Full Code Here

                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));
View Full Code Here

                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) {
View Full Code Here

                    ((CmisPropertyInteger) property).getValue());
        } else if (property instanceof CmisPropertyDecimal) {
            result = new PropertyDecimalImpl(property.getPropertyDefinitionId(),
                    ((CmisPropertyDecimal) property).getValue());
        } else if (property instanceof CmisPropertyBoolean) {
            result = new PropertyBooleanImpl(property.getPropertyDefinitionId(),
                    ((CmisPropertyBoolean) property).getValue());
        } else if (property instanceof CmisPropertyDateTime) {
            result = new PropertyDateTimeImpl(property.getPropertyDefinitionId(),
                    convertXMLCalendar(((CmisPropertyDateTime) property).getValue()));
        } else if (property instanceof CmisPropertyHtml) {
View Full Code Here

                    boolValues.add(Boolean.valueOf(s));
                }
            } catch (NumberFormatException e) {
                throw new CmisInvalidArgumentException(propDef.getId() + " value is not a boolean value!");
            }
            propertyData = new PropertyBooleanImpl(propDef.getId(), boolValues);
            break;
        case INTEGER:
            List<BigInteger> intValues = new ArrayList<BigInteger>(strValues.size());
            try {
                for (String s : strValues) {
View Full Code Here

TOP

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

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.