/** * Sets the real or rational value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple real or simple rational property definition * @param value property value */ public void set(Property property, double value) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.REAL && property.getPrimaryProperty().getValueType() != Property.ValueType.RATIONAL) { throw new PropertyTypeException(Property.ValueType.REAL, property.getPrimaryProperty().getValueType()); } set(property, Double.toString(value)); }
/** * Sets the integer value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param value property value */ public void set(Property property, int value) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.INTEGER) { throw new PropertyTypeException(Property.ValueType.INTEGER, property.getPrimaryProperty().getValueType()); } set(property, Integer.toString(value)); }
/** * Returns the value of the identified Integer based metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @return property value as a Integer, or <code>null</code> if the property is not set, or not a valid Integer */ public Integer getInt(Property property) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { return null; } if(property.getPrimaryProperty().getValueType() != Property.ValueType.INTEGER) { return null; } String v = get(property); if(v == null) { return null; } try { return Integer.valueOf(v); } catch(NumberFormatException e) { return null; } }
/** * Sets the date value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param date property value */ public void set(Property property, Date date) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { throw new PropertyTypeException(Property.ValueType.DATE, property.getPrimaryProperty().getValueType()); } String dateString = null; if (date != null) { dateString = formatDate(date); } set(property, dateString); }
/** * Sets the date value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param date property value */ public void set(Property property, Calendar date) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { throw new PropertyTypeException(Property.ValueType.DATE, property.getPrimaryProperty().getValueType()); } String dateString = null; if (date != null) { dateString = formatDate(date); } set(property, dateString); }
/** * Returns the value of the identified Date based metadata property. * * @since Apache Tika 0.8 * @param property simple date property definition * @return property value as a Date, or <code>null</code> if the property is not set, or not a valid Date */ public Date getDate(Property property) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { return null; } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { return null; } String v = get(property); if (v != null) { return parseDate(v); } else { return null; } }
/** * Sets the real or rational value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple real or simple rational property definition * @param value property value */ public void set(Property property, double value) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.REAL && property.getPrimaryProperty().getValueType() != Property.ValueType.RATIONAL) { throw new PropertyTypeException(Property.ValueType.REAL, property.getPrimaryProperty().getValueType()); } set(property, Double.toString(value)); }
/** * Sets the real or rational value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple real or simple rational property definition * @param value property value */ public void set(Property property, double value) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.REAL && property.getPrimaryProperty().getValueType() != Property.ValueType.RATIONAL) { throw new PropertyTypeException(Property.ValueType.REAL, property.getPrimaryProperty().getValueType()); } set(property, Double.toString(value)); }
/** * Sets the integer value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param value property value */ public void set(Property property, int value) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.INTEGER) { throw new PropertyTypeException(Property.ValueType.INTEGER, property.getPrimaryProperty().getValueType()); } set(property, Integer.toString(value)); }
/** * Returns the value of the identified Integer based metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @return property value as a Integer, or <code>null</code> if the property is not set, or not a valid Integer */ public Integer getInt(Property property) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { return null; } if(property.getPrimaryProperty().getValueType() != Property.ValueType.INTEGER) { return null; } String v = get(property); if(v == null) { return null; } try { return Integer.valueOf(v); } catch(NumberFormatException e) { return null; } }
/** * Returns the value of the identified Integer based metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @return property value as a Integer, or <code>null</code> if the property is not set, or not a valid Integer */ public Integer getInt(Property property) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { return null; } if(property.getPrimaryProperty().getValueType() != Property.ValueType.INTEGER) { return null; } String v = get(property); if(v == null) { return null; } try { return Integer.valueOf(v); } catch(NumberFormatException e) { return null; } }
/** * Sets the integer value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param value property value */ public void set(Property property, int value) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.INTEGER) { throw new PropertyTypeException(Property.ValueType.INTEGER, property.getPrimaryProperty().getValueType()); } set(property, Integer.toString(value)); }
/** * Sets the date value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param date property value */ public void set(Property property, Date date) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { throw new PropertyTypeException(Property.ValueType.DATE, property.getPrimaryProperty().getValueType()); } String dateString = null; if (date != null) { dateString = formatDate(date); } set(property, dateString); }
/** * Returns the value of the identified Date based metadata property. * * @since Apache Tika 0.8 * @param property simple date property definition * @return property value as a Date, or <code>null</code> if the property is not set, or not a valid Date */ public Date getDate(Property property) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { return null; } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { return null; } String v = get(property); if (v != null) { return parseDate(v); } else { return null; } }
/** * Sets the date value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param date property value */ public void set(Property property, Date date) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { throw new PropertyTypeException(Property.ValueType.DATE, property.getPrimaryProperty().getValueType()); } String dateString = null; if (date != null) { dateString = formatDate(date); } set(property, dateString); }
/** * Sets the date value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param date property value */ public void set(Property property, Calendar date) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { throw new PropertyTypeException(Property.ValueType.DATE, property.getPrimaryProperty().getValueType()); } String dateString = null; if (date != null) { dateString = formatDate(date); } set(property, dateString); }
/** * Sets the date value of the identified metadata property. * * @since Apache Tika 0.8 * @param property simple integer property definition * @param date property value */ public void set(Property property, Calendar date) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { throw new PropertyTypeException(Property.PropertyType.SIMPLE, property.getPrimaryProperty().getPropertyType()); } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { throw new PropertyTypeException(Property.ValueType.DATE, property.getPrimaryProperty().getValueType()); } String dateString = null; if (date != null) { dateString = formatDate(date); } set(property, dateString); }
/** * Returns the value of the identified Date based metadata property. * * @since Apache Tika 0.8 * @param property simple date property definition * @return property value as a Date, or <code>null</code> if the property is not set, or not a valid Date */ public Date getDate(Property property) { if(property.getPrimaryProperty().getPropertyType() != Property.PropertyType.SIMPLE) { return null; } if(property.getPrimaryProperty().getValueType() != Property.ValueType.DATE) { return null; } String v = get(property); if (v != null) { return parseDate(v); } else { return null; } }