org.apache.tika.metadata.Property.getValueType()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(12.1k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.tika.metadata.Property.getValueType()方法的一些代码示例,展示了Property.getValueType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.getValueType()方法的具体详情如下:
包路径:org.apache.tika.metadata.Property
类名称:Property
方法名:getValueType

Property.getValueType介绍

暂无

代码示例

代码示例来源:origin: apache/tika

/**
 * 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));
}

代码示例来源:origin: apache/tika

/**
 * 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));
}

代码示例来源:origin: apache/tika

/**
 * 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;
  }
}

代码示例来源:origin: apache/tika

/**
 * 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);
}

代码示例来源:origin: apache/tika

/**
 * 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);
}

代码示例来源:origin: apache/tika

/**
 * 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;
  }
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-core

/**
 * 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));
}

代码示例来源:origin: org.apache.tika/tika-core

/**
 * 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));
}

代码示例来源:origin: org.apache.tika/tika-core

/**
 * 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));
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-core

/**
 * 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;
  }
}

代码示例来源:origin: org.apache.tika/tika-core

/**
 * 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;
  }
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-core

/**
 * 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));
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-core

/**
 * 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);
}

代码示例来源:origin: org.apache.tika/tika-core

/**
 * 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;
  }
}

代码示例来源:origin: org.apache.tika/tika-core

/**
 * 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);
}

代码示例来源:origin: org.apache.tika/tika-core

/**
 * 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);
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-core

/**
 * 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);
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-core

/**
 * 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;
  }
}

相关文章