public final List<AbstractField> getAllProperties() { return container.getAllProperties(); }
public List<String> getElementsAsString() { List<String> retval; retval = new ArrayList<>(); Iterator<AbstractField> it = getContainer().getAllProperties().iterator(); AbstractSimpleProperty tmp; while (it.hasNext()) { tmp = (AbstractSimpleProperty) it.next(); retval.add(tmp.getStringValue()); } retval = Collections.unmodifiableList(retval); return retval; }
/** * Check if a XMPFieldObject is in the complex property * * @param property * The property to check * @return True if property is present in this container */ public boolean containsProperty(AbstractField property) { Iterator<AbstractField> it = getAllProperties().iterator(); AbstractField tmp; while (it.hasNext()) { tmp = it.next(); if (isSameProperty(tmp, property)) { return true; } } return false; }
List<AbstractField> absFields = getAllProperties(); if (absFields != null)
/** * Retrieve a generic simple type property * * @param qualifiedName * Full qualified name of property wanted * @return The generic simple type property according to its qualified name */ public AbstractField getAbstractProperty(String qualifiedName) { for (AbstractField child : getContainer().getAllProperties()) { if (child.getPropertyName().equals(qualifiedName)) { return child; } } return null; }
Iterator<AbstractField> it = alt.getAllProperties().iterator(); AbstractField xdefault = null; boolean xdefaultFound = false; it = alt.getAllProperties().iterator(); List<AbstractField> reordered = new ArrayList<>(); List<AbstractField> toDelete = new ArrayList<>();
/** * Get all the date values in a sequence property. * * @param seqName * The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords". * * @return A read-only list of java.util.Calendar objects or null if the property does not exist. * */ public List<Calendar> getUnqualifiedSequenceDateValueList(String seqName) { List<Calendar> retval = null; ArrayProperty seq = (ArrayProperty) getAbstractProperty(seqName); if (seq != null) { retval = new ArrayList<>(); for (AbstractField child : seq.getContainer().getAllProperties()) { if (child instanceof DateType) { retval.add(((DateType) child).getValue()); } } } return retval; }
private boolean mergeComplexProperty(Iterator<AbstractField> itNewValues, ArrayProperty arrayProperty) { while (itNewValues.hasNext()) { TextType tmpNewValue = (TextType) itNewValues.next(); for (AbstractField abstractField : arrayProperty.getContainer().getAllProperties()) { TextType tmpOldValue = (TextType) abstractField; if (tmpOldValue.getStringValue().equals(tmpNewValue.getStringValue())) { return true; } } arrayProperty.getContainer().addProperty(tmpNewValue); } return false; }
/** * Generic method to remove a field from an array with an Elementable Object * * @param arrayName * the name of the property concerned * @param fieldValue * the elementable field value */ public void removeUnqualifiedArrayValue(String arrayName, AbstractField fieldValue) { ArrayProperty array = (ArrayProperty) getAbstractProperty(arrayName); if (array != null) { List<AbstractField> toDelete = new ArrayList<>(); for (AbstractField abstractField : array.getContainer().getAllProperties()) { AbstractSimpleProperty tmp = (AbstractSimpleProperty) abstractField; if (tmp.equals(fieldValue)) { toDelete.add(tmp); } } for (AbstractField aToDelete : toDelete) { array.getContainer().removeProperty(aToDelete); } } }
for (AbstractField child : arrayProp.getContainer().getAllProperties())
/** * Generic array property removing * * @param fieldValue * the field value */ private void removeUnqualifiedArrayValue(String arrayName, String fieldValue) { ArrayProperty array = (ArrayProperty) getAbstractProperty(arrayName); if (array != null) { List<AbstractField> toDelete = new ArrayList<>(); for (AbstractField abstractField : array.getContainer().getAllProperties()) { AbstractSimpleProperty tmp = (AbstractSimpleProperty) abstractField; if (tmp.getStringValue().equals(fieldValue)) { toDelete.add(tmp); } } for (AbstractField aToDelete : toDelete) { array.getContainer().removeProperty(aToDelete); } } }
/** * Get an AbstractField list corresponding to the content of an array * property. * * @param name The property name whitout namespace. * @return List of properties contained in the array property. * @throws BadFieldValueException If the property with the requested name isn't an array. */ public List<AbstractField> getUnqualifiedArrayList(String name) throws BadFieldValueException { ArrayProperty array = null; for (AbstractField child : getAllProperties()) { if (child.getPropertyName().equals(name)) { if (child instanceof ArrayProperty) { array = (ArrayProperty) child; break; } throw new BadFieldValueException("Property asked is not an array"); } } if (array != null) { return new ArrayList<>(array.getContainer().getAllProperties()); } return null; }
Iterator<AbstractField> it = dc.getTitleProperty().getContainer().getAllProperties().iterator(); boolean empty = true; while (it.hasNext())
/** * Remove a date sequence value from the list. * * @param seqName * The name of the sequence property, it must include the namespace prefix, e.g. "pdf:Keywords" * @param date * The date to remove from the sequence property. */ public void removeUnqualifiedSequenceDateValue(String seqName, Calendar date) { ArrayProperty seq = (ArrayProperty) getAbstractProperty(seqName); if (seq != null) { List<AbstractField> toDelete = new ArrayList<>(); for (AbstractField tmp : seq.getContainer().getAllProperties()) { if (tmp instanceof DateType && ((DateType) tmp).getValue().equals(date)) { toDelete.add(tmp); } } for (AbstractField aToDelete : toDelete) { seq.getContainer().removeProperty(aToDelete); } } }
for (AbstractField child : arrayProp.getContainer().getAllProperties())
for (AbstractField child : xmpSchema.getContainer().getAllProperties()) tmpEmbeddedProperty.getPropertyName().equals(analyzedPropQualifiedName)) Iterator<AbstractField> itNewValues = ((ArrayProperty) child).getContainer().getAllProperties().iterator(); if (mergeComplexProperty(itNewValues, (ArrayProperty) tmpEmbeddedProperty))
Iterator<AbstractField> it = dc.getTitleProperty().getContainer().getAllProperties().iterator(); if (it.hasNext())
|| copyrights.getContainer().getAllProperties().isEmpty())
for (AbstractField child : getContainer().getAllProperties())
for (AbstractField child : arrayProp.getContainer().getAllProperties())