/** * Creates a CMIS object that only contains an id in the property list. */ protected ObjectData createIdObject(String objectId) { ObjectDataImpl object = new ObjectDataImpl(); PropertiesImpl properties = new PropertiesImpl(); object.setProperties(properties); properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_ID, objectId)); return object; }
@Override public void replaceProperty(PropertyData<?> property) { if (property == null || property.getId() == null) { return; } removeProperty(property.getId()); propertyList.add(property); properties.put(property.getId(), property); }
/** * Shallow copy constructor. * * Creates a new collection of properties but references the original * property and extension objects. */ public PropertiesImpl(Properties properties) { if (properties == null) { throw new IllegalArgumentException("Properties not set!"); } addProperties(properties.getPropertyList()); setExtensions(properties.getExtensions()); }
@Override public MutableProperties createPropertiesData(List<PropertyData<?>> properties) { return new PropertiesImpl(properties); }
protected void addProperties(Collection<PropertyData<?>> properties) { if (properties != null) { for (PropertyData<?> prop : properties) { addProperty(prop); } } }
properties = new PropertiesImpl(); if (changeToken != null && !omitChangeToken) { ((PropertiesImpl) properties) .addProperty(new PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken)); properties = new PropertiesImpl(properties); ((PropertiesImpl) properties).removeProperty(PropertyIds.CHANGE_TOKEN); properties = new PropertiesImpl(properties); ((PropertiesImpl) properties).addProperty(new PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken));
final PropertiesImpl newProperties = new PropertiesImpl(); newProperties.addProperty(new PropertyStringImpl(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, secondaryTypeIds)); newProperties.replaceProperty(new PropertyStringImpl(PropertyIds.NAME, updatedName));
changeToken = extractChangeToken(properties); if (changeToken != null) { properties = new PropertiesImpl(properties); ((PropertiesImpl) properties).removeProperty(PropertyIds.CHANGE_TOKEN);
if ((props == null) || (props.getProperties() == null)) { throw new IllegalArgumentException("Props must not be null!"); 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: props.addProperty(new PropertyDecimalImpl(propDef.getId(), (List<BigDecimal>)defaultValue)); break; case HTML: props.addProperty(new PropertyHtmlImpl(propDef.getId(), (List<String>)defaultValue)); break; case ID: props.addProperty(new PropertyIdImpl(propDef.getId(), (List<String>)defaultValue)); break; case INTEGER: props.addProperty(new PropertyIntegerImpl(propDef.getId(), (List<BigInteger>)defaultValue)); break; case STRING: props.addProperty(new PropertyStringImpl(propDef.getId(), (List<String>)defaultValue)); break; case URI: props.addProperty(new PropertyUriImpl(propDef.getId(), (List<String>)defaultValue)); break; default:
/** * Constructor. * * @param properties * initial collection of properties */ public PropertiesImpl(Collection<PropertyData<?>> properties) { addProperties(properties); }
((PropertiesImpl) object.getProperties()).replaceProperty(nameProperty);
@Override protected PropertiesImpl prepareTarget(XMLStreamReader parser, QName name) throws XMLStreamException { return new PropertiesImpl(); }
protected void addProperties(Collection<PropertyData<?>> properties) { if (properties != null) { for (PropertyData<?> prop : properties) { addProperty(prop); } } }
/** * Constructor. * * @param properties * initial collection of properties */ public PropertiesImpl(Collection<PropertyData<?>> properties) { addProperties(properties); }
/** * Creates a CMIS object that only contains an ID in the property list. */ protected ObjectData createIdObject(String objectId) { ObjectDataImpl object = new ObjectDataImpl(); PropertiesImpl properties = new PropertiesImpl(); object.setProperties(properties); properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_ID, objectId)); return object; }
@Override protected PropertiesImpl prepareTarget(XmlPullParser parser, QName name) throws XmlPullParserException { return new PropertiesImpl(); }
/** * Add integer property to the CMIS object represented by this instance */ protected final void addPropertyInteger(PropertiesImpl props, String typeId, Set<String> filter, String id, long value) { if (!checkAddProperty(props, typeId, filter, id)) { return; } PropertyIntegerImpl prop = new PropertyIntegerImpl(id, BigInteger.valueOf(value)); prop.setQueryName(id); props.addProperty(prop); }
@Override public void replaceProperty(PropertyData<?> property) { if (property == null || property.getId() == null) { return; } removeProperty(property.getId()); propertyList.add(property); properties.put(property.getId(), property); }
/** * Shallow copy constructor. * * Creates a new collection of properties but references the original * property and extension objects. */ public PropertiesImpl(Properties properties) { if (properties == null) { throw new IllegalArgumentException("Properties not set!"); } addProperties(properties.getPropertyList()); setExtensions(properties.getExtensions()); }
/** * Converts a properties object. */ public static Properties convert(CmisPropertiesType properties) { if (properties == null) { return null; } PropertiesImpl result = new PropertiesImpl(); for (CmisProperty property : properties.getProperty()) { result.addProperty(convert(property)); } // handle extensions convertExtension(properties, result); return result; }