Package org.apache.padaf.xmpbox.type

Examples of org.apache.padaf.xmpbox.type.AbstractField


   *            description
   * @return the value of property specified
   */
  private String getPdfaTextValue(String qualifiedName) {
    Iterator<AbstractField> it = content.getAllProperties().iterator();
    AbstractField tmp;
    while (it.hasNext()) {
      tmp = it.next();
      if (tmp.getQualifiedName().equals(qualifiedName)) {
        return ((TextType) tmp).getStringValue();
      }
    }
    return null;
  }
View Full Code Here


     *            Full qualified name of proeprty wanted
     * @return The generic simple type property according to its qualified Name
     */
    public AbstractField getAbstractProperty(String qualifiedName) {
        Iterator<AbstractField> it = content.getAllProperties().iterator();
        AbstractField tmp;
        while (it.hasNext()) {
            tmp = it.next();
            if (tmp.getQualifiedName().equals(qualifiedName)) {
                return tmp;
            }
        }
        return null;

View Full Code Here

        AbstractSimpleProperty specifiedTypeProperty;
        if (propertyValue == null) {
            // Search in properties to erase
            Iterator<AbstractField> it = content.getAllProperties().iterator();
            AbstractField tmp;
            while (it.hasNext()) {
                tmp = it.next();
                if (tmp.getQualifiedName().equals(qualifiedName)) {
                    content.removeProperty(tmp);
                    return;
                }
            }
        } else {
            try {
                propertyConstructor = type.getConstructor(propertyArgsClass);
                specifiedTypeProperty = (AbstractSimpleProperty) propertyConstructor
                .newInstance(propertyArgs);
            } catch (Exception e) {
                throw new IllegalArgumentException(
                        "Failed to create property with the specified type given in parameters",
                        e);
            }
            // attribute placement for simple property has been removed
            // Search in properties to erase
            Iterator<AbstractField> it = content.getAllProperties().iterator();
            AbstractField tmp;
            while (it.hasNext()) {
                tmp = it.next();
                if (tmp.getQualifiedName().equals(qualifiedName)) {
                    content.removeProperty(tmp);
                    content.addProperty(specifiedTypeProperty);
                    return;
                }
            }
View Full Code Here

     */
    private void setSpecifiedSimpleTypeProperty(AbstractSimpleProperty prop) {
        // attribute placement for simple property has been removed
        // Search in properties to erase
        Iterator<AbstractField> it = content.getAllProperties().iterator();
        AbstractField tmp;
        while (it.hasNext()) {
            tmp = it.next();
            if (tmp.getQualifiedName().equals(prop.getQualifiedName())) {
                content.removeProperty(tmp);
                content.addProperty(prop);
                return;
            }
        }
View Full Code Here

     * @param qualifiedName
     *            The full qualified name of the property wanted
     * @return The Text Type property wanted
     */
    public TextType getTextProperty(String qualifiedName) {
        AbstractField prop = getAbstractProperty(qualifiedName);
        if (prop != null) {
            if (prop instanceof TextType) {
                return (TextType) prop;
            } else {
                throw new IllegalArgumentException(
View Full Code Here

     *
     * @return The value of the text property or the null if there is no value.
     *
     */
    public String getTextPropertyValue(String qualifiedName) {
        AbstractField prop = getAbstractProperty(qualifiedName);
        if (prop != null) {
            if (prop instanceof TextType) {
                return ((TextType) prop).getStringValue();
            } else {
                throw new IllegalArgumentException(
View Full Code Here

     *            prefix. ie "pdf:Keywords".
     * @return Date Type property
     *
     */
    public DateType getDateProperty(String qualifiedName) {
        AbstractField prop = getAbstractProperty(qualifiedName);
        if (prop != null) {
            if (prop instanceof DateType) {
                return (DateType) prop;
            } else {
                throw new IllegalArgumentException(
View Full Code Here

     *
     * @return The value of the property as a date.
     *
     */
    public Calendar getDatePropertyValue(String qualifiedName) {
        AbstractField prop = getAbstractProperty(qualifiedName);
        if (prop != null) {
            if (prop instanceof DateType) {
                return ((DateType) prop).getValue();
            } else {
                throw new IllegalArgumentException(
View Full Code Here

     * @param qualifiedName
     *            the full qualified name of property wanted
     * @return boolean Type property
     */
    public BooleanType getBooleanProperty(String qualifiedName) {
        AbstractField prop = getAbstractProperty(qualifiedName);
        if (prop != null) {
            if (prop instanceof BooleanType) {
                return (BooleanType) prop;
            } else {
                throw new IllegalArgumentException(
View Full Code Here

     *
     * @return The value of the property as a boolean. Return null if property
     *         not exist
     */
    public Boolean getBooleanPropertyValue(String qualifiedName) {
        AbstractField prop = getAbstractProperty(qualifiedName);
        if (prop != null) {
            if (prop instanceof BooleanType) {
                return ((BooleanType) prop).getValue();
            } else {
                throw new IllegalArgumentException(
View Full Code Here

TOP

Related Classes of org.apache.padaf.xmpbox.type.AbstractField

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.