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

                    ((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

                    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

        }
    }

    private static PropertyData<?> getEmptyValue(PropertyDefinition<?> propDef) {
        if (propDef.getPropertyType().equals(PropertyType.BOOLEAN))
            return new PropertyBooleanImpl(propDef.getId(), (Boolean) null);
        else if (propDef.getPropertyType().equals(PropertyType.DATETIME))
            return new PropertyDateTimeImpl(propDef.getId(), (GregorianCalendar) null);
        else if (propDef.getPropertyType().equals(PropertyType.DECIMAL))
            return new PropertyDecimalImpl(propDef.getId(), (BigDecimal) null);
        else if (propDef.getPropertyType().equals(PropertyType.HTML))
View Full Code Here

                        }
                        ((PropertyIdImpl) property).setValues(propertyValues);
                    }
                    break;
                case BOOLEAN:
                    property = new PropertyBooleanImpl();
                    {
                        List<Boolean> propertyValues = null;
                        if (values != null) {
                            propertyValues = new ArrayList<Boolean>();
                            for (Object obj : values) {
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

        }
    }

    private static PropertyData<?> getEmptyValue(PropertyDefinition<?> propDef) {
        if (propDef.getPropertyType().equals(PropertyType.BOOLEAN))
            return new PropertyBooleanImpl(propDef.getId(), (Boolean) null);
        else if (propDef.getPropertyType().equals(PropertyType.DATETIME))
            return new PropertyDateTimeImpl(propDef.getId(), (GregorianCalendar) null);
        else if (propDef.getPropertyType().equals(PropertyType.DECIMAL))
            return new PropertyDecimalImpl(propDef.getId(), (BigDecimal) null);
        else if (propDef.getPropertyType().equals(PropertyType.HTML))
View Full Code Here

   
    private static AbstractPropertyData<?> clonePropertyData(PropertyData<?> prop) {
        AbstractPropertyData<?> ad = null;
       
        if (prop instanceof PropertyBooleanImpl) {
            PropertyBooleanImpl clone = new PropertyBooleanImpl();
            clone.setValues(((PropertyBooleanImpl)prop).getValues());
            ad = clone;
        } else if (prop instanceof PropertyDateTimeImpl) {
            PropertyDateTimeImpl clone = new PropertyDateTimeImpl();
            clone.setValues(((PropertyDateTimeImpl)prop).getValues());
            ad = clone;
        } else if (prop instanceof PropertyDecimalImpl) {
            PropertyDecimalImpl clone = new PropertyDecimalImpl();
            clone.setValues(((PropertyDecimalImpl)prop).getValues());
            ad = clone;
        } else if (prop instanceof PropertyHtmlImpl) {
            PropertyHtmlImpl clone = new PropertyHtmlImpl();
            clone.setValues(((PropertyHtmlImpl)prop).getValues());
            ad = clone;
        } else if (prop instanceof PropertyIdImpl) {
            PropertyIdImpl clone = new PropertyIdImpl();
            clone.setValues(((PropertyIdImpl)prop).getValues());
            ad = clone;
        } else if (prop instanceof PropertyIntegerImpl) {
            PropertyIntegerImpl clone = new PropertyIntegerImpl();
            clone.setValues(((PropertyIntegerImpl)prop).getValues());
            ad = clone;
        } else if (prop instanceof PropertyStringImpl) {
            PropertyStringImpl clone = new PropertyStringImpl();
            clone.setValues(((PropertyStringImpl)prop).getValues());
            ad = clone;
        } else if (prop instanceof PropertyUriImpl) {
            PropertyUriImpl clone = new PropertyUriImpl();
            clone.setValues(((PropertyUriImpl)prop).getValues());
            ad = clone;
        } else {
            throw new RuntimeException("Unknown property type: " + prop.getClass());
        }
       
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.