gpt4 book ai didi

com.adobe.xmp.XMPMeta.setProperty()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 05:57:05 28 4
gpt4 key购买 nike

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

XMPMeta.setProperty介绍

暂无

代码示例

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

/**
 * Creates a simple property.
 *
 * @param tikaKey
 *            Key in the Tika metadata map
 * @param ns
 *            namespace the property should be created in
 * @param propertyName
 *            name of the property
 * @throws XMPException
 *             if the property could not be created
 */
protected void createProperty(String tikaKey, String ns, String propertyName)
    throws XMPException {
  String value = metadata.get( tikaKey );
  if (value != null && value.length() > 0) {
    meta.setProperty( ns, propertyName, value );
  }
}

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

/**
 * Sets the given property. If the property already exists, it is overwritten. Only simple
 * properties that use a registered prefix are stored in the XMP.
 *
 * @see org.apache.tika.metadata.Metadata#set(java.lang.String, java.lang.String)
 */
@Override
public void set(String name, String value) {
  checkKey( name );
  String[] keyParts = splitKey( name );
  String ns = registry.getNamespaceURI( keyParts[0] );
  if (ns != null) {
    try {
      xmpData.setProperty( ns, keyParts[1], value );
    }
    catch (XMPException e) {
      // Ignore
    }
  }
}

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

/**
 * Creates an array property from a list of values.
 *
 * @param tikaKey
 *            Key in the Tika metadata map
 * @param ns
 *            namespace the property should be created in
 * @param propertyName
 *            name of the property
 * @param arrayType
 *            depicts which kind of array shall be created
 * @throws XMPException
 *             if the property could not be created
 */
protected void createArrayProperty(String tikaKey, String ns, String propertyName, int arrayType)
    throws XMPException {
  String[] values = metadata.getValues( tikaKey );
  if (values != null) {
    meta.setProperty( ns, propertyName, null, new PropertyOptions( arrayType ) );
    for (String value : values) {
      meta.appendArrayItem( ns, propertyName, value );
    }
  }
}

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

/**
 * Sets array properties. If the property already exists, it is overwritten. Only array
 * properties that use a registered prefix are stored in the XMP.
 *
 * @see org.apache.tika.metadata.Metadata#set(org.apache.tika.metadata.Property,
 *      java.lang.String[])
 */
@Override
public void set(Property property, String[] values) {
  checkKey( property.getName() );
  if (!property.isMultiValuePermitted()) {
    throw new PropertyTypeException( "Property is not of an array type" );
  }
  String[] keyParts = splitKey( property.getName() );
  String ns = registry.getNamespaceURI( keyParts[0] );
  if (ns != null) {
    try {
      int arrayType = tikaToXMPArrayType( property.getPrimaryProperty().getPropertyType() );
      xmpData.setProperty( ns, keyParts[1], null, new PropertyOptions( arrayType ) );
      for (String value : values) {
        xmpData.appendArrayItem( ns, keyParts[1], value );
      }
    }
    catch (XMPException e) {
      // Ignore
    }
  }
}

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

meta.setProperty( XMPConst.NS_XMP, "CreatorTool", creatorTool );

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

/**
 * Creates a simple property.
 *
 * @param tikaKey
 *            Key in the Tika metadata map
 * @param ns
 *            namespace the property should be created in
 * @param propertyName
 *            name of the property
 * @throws XMPException
 *             if the property could not be created
 */
protected void createProperty(String tikaKey, String ns, String propertyName)
    throws XMPException {
  String value = metadata.get( tikaKey );
  if (value != null && value.length() > 0) {
    meta.setProperty( ns, propertyName, value );
  }
}

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

/**
 * Creates a simple property.
 *
 * @param tikaKey
 *            Key in the Tika metadata map
 * @param ns
 *            namespace the property should be created in
 * @param propertyName
 *            name of the property
 * @throws XMPException
 *             if the property could not be created
 */
protected void createProperty(String tikaKey, String ns, String propertyName)
    throws XMPException {
  String value = metadata.get( tikaKey );
  if (value != null && value.length() > 0) {
    meta.setProperty( ns, propertyName, value );
  }
}

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

/**
 * Sets the given property. If the property already exists, it is overwritten. Only simple
 * properties that use a registered prefix are stored in the XMP.
 *
 * @see org.apache.tika.metadata.Metadata#set(java.lang.String, java.lang.String)
 */
@Override
public void set(String name, String value) {
  checkKey( name );
  String[] keyParts = splitKey( name );
  String ns = registry.getNamespaceURI( keyParts[0] );
  if (ns != null) {
    try {
      xmpData.setProperty( ns, keyParts[1], value );
    }
    catch (XMPException e) {
      // Ignore
    }
  }
}

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

/**
 * Sets the given property. If the property already exists, it is overwritten. Only simple
 * properties that use a registered prefix are stored in the XMP.
 *
 * @see org.apache.tika.metadata.Metadata#set(java.lang.String, java.lang.String)
 */
@Override
public void set(String name, String value) {
  checkKey( name );
  String[] keyParts = splitKey( name );
  String ns = registry.getNamespaceURI( keyParts[0] );
  if (ns != null) {
    try {
      xmpData.setProperty( ns, keyParts[1], value );
    }
    catch (XMPException e) {
      // Ignore
    }
  }
}

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

/**
 * Creates an array property from a list of values.
 *
 * @param tikaKey
 *            Key in the Tika metadata map
 * @param ns
 *            namespace the property should be created in
 * @param propertyName
 *            name of the property
 * @param arrayType
 *            depicts which kind of array shall be created
 * @throws XMPException
 *             if the property could not be created
 */
protected void createArrayProperty(String tikaKey, String ns, String propertyName, int arrayType)
    throws XMPException {
  String[] values = metadata.getValues( tikaKey );
  if (values != null) {
    meta.setProperty( ns, propertyName, null, new PropertyOptions( arrayType ) );
    for (String value : values) {
      meta.appendArrayItem( ns, propertyName, value );
    }
  }
}

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

/**
 * Creates an array property from a list of values.
 *
 * @param tikaKey
 *            Key in the Tika metadata map
 * @param ns
 *            namespace the property should be created in
 * @param propertyName
 *            name of the property
 * @param arrayType
 *            depicts which kind of array shall be created
 * @throws XMPException
 *             if the property could not be created
 */
protected void createArrayProperty(String tikaKey, String ns, String propertyName, int arrayType)
    throws XMPException {
  String[] values = metadata.getValues( tikaKey );
  if (values != null) {
    meta.setProperty( ns, propertyName, null, new PropertyOptions( arrayType ) );
    for (String value : values) {
      meta.appendArrayItem( ns, propertyName, value );
    }
  }
}

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

/**
 * Sets array properties. If the property already exists, it is overwritten. Only array
 * properties that use a registered prefix are stored in the XMP.
 *
 * @see org.apache.tika.metadata.Metadata#set(org.apache.tika.metadata.Property,
 *      java.lang.String[])
 */
@Override
public void set(Property property, String[] values) {
  checkKey( property.getName() );
  if (!property.isMultiValuePermitted()) {
    throw new PropertyTypeException( "Property is not of an array type" );
  }
  String[] keyParts = splitKey( property.getName() );
  String ns = registry.getNamespaceURI( keyParts[0] );
  if (ns != null) {
    try {
      int arrayType = tikaToXMPArrayType( property.getPrimaryProperty().getPropertyType() );
      xmpData.setProperty( ns, keyParts[1], null, new PropertyOptions( arrayType ) );
      for (String value : values) {
        xmpData.appendArrayItem( ns, keyParts[1], value );
      }
    }
    catch (XMPException e) {
      // Ignore
    }
  }
}

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

/**
 * Sets array properties. If the property already exists, it is overwritten. Only array
 * properties that use a registered prefix are stored in the XMP.
 *
 * @see org.apache.tika.metadata.Metadata#set(org.apache.tika.metadata.Property,
 *      java.lang.String[])
 */
@Override
public void set(Property property, String[] values) {
  checkKey( property.getName() );
  if (!property.isMultiValuePermitted()) {
    throw new PropertyTypeException( "Property is not of an array type" );
  }
  String[] keyParts = splitKey( property.getName() );
  String ns = registry.getNamespaceURI( keyParts[0] );
  if (ns != null) {
    try {
      int arrayType = tikaToXMPArrayType( property.getPrimaryProperty().getPropertyType() );
      xmpData.setProperty( ns, keyParts[1], null, new PropertyOptions( arrayType ) );
      for (String value : values) {
        xmpData.appendArrayItem( ns, keyParts[1], value );
      }
    }
    catch (XMPException e) {
      // Ignore
    }
  }
}

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

meta.setProperty( XMPConst.NS_XMP, "CreatorTool", creatorTool );

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

meta.setProperty( XMPConst.NS_XMP, "CreatorTool", creatorTool );

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com