- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.adobe.xmp.XMPMeta
类的一些代码示例,展示了XMPMeta
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMPMeta
类的具体详情如下:
包路径:com.adobe.xmp.XMPMeta
类名称:XMPMeta
[英]This class represents the set of XMP metadata as a DOM representation. It has methods to read and modify all kinds of properties, create an iterator over all properties and serialize the metadata to a String, byte-array or OutputStream
.
[中]此类将XMP元数据集表示为DOM表示。它具有读取和修改各种属性、对所有属性创建迭代器以及将元数据序列化为字符串、字节数组或OutputStream
的方法。
代码示例来源:origin: drewnoakes/metadata-extractor
/**
* Gets a map of all XMP properties in this directory.
* <p>
* This is required because XMP properties are represented as strings, whereas the rest of this library
* uses integers for keys.
*/
@NotNull
public Map<String, String> getXmpProperties()
{
Map<String, String> propertyValueByPath = new HashMap<String, String>();
if (_xmpMeta != null)
{
try {
IteratorOptions options = new IteratorOptions().setJustLeafnodes(true);
for (Iterator i = _xmpMeta.iterator(options); i.hasNext(); ) {
XMPPropertyInfo prop = (XMPPropertyInfo)i.next();
String path = prop.getPath();
String value = prop.getValue();
if (path != null && value != null) {
propertyValueByPath.put(path, value);
}
}
} catch (XMPException ignored) {
}
}
return Collections.unmodifiableMap(propertyValueByPath);
}
代码示例来源:origin: apache/tika
/**
* Creates a language alternative property in the x-default language
*
* @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 createLangAltProperty(String tikaKey, String ns, String propertyName)
throws XMPException {
String value = metadata.get( tikaKey );
if (value != null && value.length() > 0) {
meta.setLocalizedText( ns, propertyName, null, XMPConst.X_DEFAULT, value );
}
}
代码示例来源: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
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
int size = xmpData.countArrayItems( ns, keyParts[1] );
value = new String[size];
boolean onlySimpleChildren = true;
prop = xmpData.getArrayItem( ns, keyParts[1], i + 1 );
if (prop.getOptions().isSimple()) {
value[i] = prop.getValue();
代码示例来源:origin: apache/tika
private void checkOOXMLMetadata(XMPMeta xmp) throws XMPException {
// check simple property
XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "language" );
assertNotNull( prop );
assertEquals( "language", prop.getValue() );
// check lang alt
prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
assertNotNull( prop );
assertEquals( "title", prop.getValue() );
// check array
prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 1 );
assertNotNull( prop );
assertEquals( "keyword1", prop.getValue() );
prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 2 );
assertNotNull( prop );
assertEquals( "keyword2", prop.getValue() );
// check OOXML specific simple property
prop = xmp.getProperty( OfficeOpenXMLCore.NAMESPACE_URI, "lastModifiedBy" );
assertNotNull( prop );
assertEquals( "lastModifiedBy", prop.getValue() );
}
代码示例来源:origin: apache/tika
/**
* Returns the value of a simple property or the first one of an array. The given name must
* contain a namespace prefix of a registered namespace.
*
* @see org.apache.tika.metadata.Metadata#get(java.lang.String)
*/
@Override
public String get(String name) {
checkKey( name );
String value = null;
String[] keyParts = splitKey( name );
String ns = registry.getNamespaceURI( keyParts[0] );
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
if (prop != null && prop.getOptions().isSimple()) {
value = prop.getValue();
}
else if (prop != null && prop.getOptions().isArray()) {
prop = xmpData.getArrayItem( ns, keyParts[1], 1 );
value = prop.getValue();
}
// in all other cases, null is returned
}
catch (XMPException e) {
// Ignore
}
}
return value;
}
代码示例来源: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
@Test
public void convert_OOXMLMetadataWithoutMimetype_onlyGeneralMetadataconverted()
throws XMPException, TikaException {
setupOOXMLMetadata( tikaMetadata );
XMPMeta xmp = TikaToXMP.convert( tikaMetadata, null );
// general metadata is converted
// check simple property
XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "language" );
assertNotNull( prop );
assertEquals( "language", prop.getValue() );
// check lang alt
prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
assertNotNull( prop );
assertEquals( "title", prop.getValue() );
// OOXML one is not, the namespace has also not been registiered as the converter has not
// been used
XMPMetaFactory.getSchemaRegistry().registerNamespace( OfficeOpenXMLCore.NAMESPACE_URI,
OfficeOpenXMLCore.PREFIX );
prop = xmp.getProperty( OfficeOpenXMLCore.NAMESPACE_URI, "lastModifiedBy" );
assertNull( prop );
}
代码示例来源:origin: apache/tika
/**
* Checks if the named property is an array.
*
* @see org.apache.tika.metadata.Metadata#isMultiValued(java.lang.String)
*/
@Override
public boolean isMultiValued(String name) {
checkKey( name );
String[] keyParts = splitKey( name );
String ns = registry.getNamespaceURI( keyParts[0] );
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
return prop.getOptions().isArray();
}
catch (XMPException e) {
// Ignore
}
}
return false;
}
代码示例来源:origin: apache/tika
/**
* Removes the given property from the XMP data. If it is a complex property the whole subtree
* is removed
*
* @see org.apache.tika.metadata.Metadata#remove(java.lang.String)
*/
@Override
public void remove(String name) {
checkKey( name );
String[] keyParts = splitKey( name );
String ns = registry.getNamespaceURI( keyParts[0] );
if (ns != null) {
xmpData.deleteProperty( ns, keyParts[1] );
}
}
代码示例来源:origin: org.apache.tika/tika-xmp
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
int size = xmpData.countArrayItems( ns, keyParts[1] );
value = new String[size];
boolean onlySimpleChildren = true;
prop = xmpData.getArrayItem( ns, keyParts[1], i + 1 );
if (prop.getOptions().isSimple()) {
value[i] = prop.getValue();
代码示例来源:origin: apache/tika
@Test
public void process_genericConversion_ok() throws TikaException, XMPException {
xmpMeta.process( tikaMetadata, GENERIC_MIMETYPE );
XMPMeta xmp = xmpMeta.getXMPData();
// check simple property
XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "format" );
assertNotNull( prop );
assertEquals( GENERIC_MIMETYPE, prop.getValue() );
// check lang alt
prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
assertNotNull( prop );
assertEquals( "title", prop.getValue() );
// check array
prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 1 );
assertNotNull( prop );
assertEquals( "keyword1", prop.getValue() );
prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 2 );
assertNotNull( prop );
assertEquals( "keyword2", prop.getValue() );
}
代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-xmp
/**
* Returns the value of a simple property or the first one of an array. The given name must
* contain a namespace prefix of a registered namespace.
*
* @see org.apache.tika.metadata.Metadata#get(java.lang.String)
*/
@Override
public String get(String name) {
checkKey( name );
String value = null;
String[] keyParts = splitKey( name );
String ns = registry.getNamespaceURI( keyParts[0] );
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
if (prop != null && prop.getOptions().isSimple()) {
value = prop.getValue();
}
else if (prop != null && prop.getOptions().isArray()) {
prop = xmpData.getArrayItem( ns, keyParts[1], 1 );
value = prop.getValue();
}
// in all other cases, null is returned
}
catch (XMPException e) {
// Ignore
}
}
return 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: org.apache.tika/tika-xmp
/**
* Checks if the named property is an array.
*
* @see org.apache.tika.metadata.Metadata#isMultiValued(java.lang.String)
*/
@Override
public boolean isMultiValued(String name) {
checkKey( name );
String[] keyParts = splitKey( name );
String ns = registry.getNamespaceURI( keyParts[0] );
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
return prop.getOptions().isArray();
}
catch (XMPException e) {
// Ignore
}
}
return false;
}
代码示例来源:origin: org.apache.tika/tika-xmp
/**
* Removes the given property from the XMP data. If it is a complex property the whole subtree
* is removed
*
* @see org.apache.tika.metadata.Metadata#remove(java.lang.String)
*/
@Override
public void remove(String name) {
checkKey( name );
String[] keyParts = splitKey( name );
String ns = registry.getNamespaceURI( keyParts[0] );
if (ns != null) {
xmpData.deleteProperty( ns, keyParts[1] );
}
}
代码示例来源:origin: drewnoakes/metadata-extractor
public void setXMPMeta(@NotNull XMPMeta xmpMeta)
{
_xmpMeta = xmpMeta;
try {
int valueCount = 0;
IteratorOptions options = new IteratorOptions().setJustLeafnodes(true);
for (Iterator i = _xmpMeta.iterator(options); i.hasNext(); ) {
XMPPropertyInfo prop = (XMPPropertyInfo)i.next();
if (prop.getPath() != null) {
valueCount++;
}
}
setInt(TAG_XMP_VALUE_COUNT, valueCount);
} catch (XMPException ignored) {
}
}
代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-xmp
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
int size = xmpData.countArrayItems( ns, keyParts[1] );
value = new String[size];
boolean onlySimpleChildren = true;
prop = xmpData.getArrayItem( ns, keyParts[1], i + 1 );
if (prop.getOptions().isSimple()) {
value[i] = prop.getValue();
代码示例来源:origin: apache/tika
@Test
public void convert_genericMetadataAllQualified_allConverted() throws XMPException,
TikaException {
// simple property
tikaMetadata.set( TikaCoreProperties.FORMAT, GENERIC_MIMETYPE );
// language alternative
tikaMetadata.set( TikaCoreProperties.TITLE, "title" );
// array
tikaMetadata.set( TikaCoreProperties.SUBJECT, new String[] { "keyword1", "keyword2" } );
XMPMeta xmp = TikaToXMP.convert( tikaMetadata, null );
// check simple property
XMPProperty prop = xmp.getProperty( XMPConst.NS_DC, "format" );
assertNotNull( prop );
assertEquals( GENERIC_MIMETYPE, prop.getValue() );
// check lang alt
prop = xmp.getLocalizedText( XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT );
assertNotNull( prop );
assertEquals( "title", prop.getValue() );
// check array
prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 1 );
assertNotNull( prop );
assertEquals( "keyword1", prop.getValue() );
prop = xmp.getArrayItem( XMPConst.NS_DC, "subject", 2 );
assertNotNull( prop );
assertEquals( "keyword2", prop.getValue() );
}
代码示例来源:origin: org.apache.tika/tika-xmp
/**
* Returns the value of a simple property or the first one of an array. The given name must
* contain a namespace prefix of a registered namespace.
*
* @see org.apache.tika.metadata.Metadata#get(java.lang.String)
*/
@Override
public String get(String name) {
checkKey( name );
String value = null;
String[] keyParts = splitKey( name );
String ns = registry.getNamespaceURI( keyParts[0] );
if (ns != null) {
try {
XMPProperty prop = xmpData.getProperty( ns, keyParts[1] );
if (prop != null && prop.getOptions().isSimple()) {
value = prop.getValue();
}
else if (prop != null && prop.getOptions().isArray()) {
prop = xmpData.getArrayItem( ns, keyParts[1], 1 );
value = prop.getValue();
}
// in all other cases, null is returned
}
catch (XMPException e) {
// Ignore
}
}
return value;
}
我是 Adobe InDesign Server 的新手,我很难找到一个好的厨房水槽应用程序。我从 SDK 获得的所有示例似乎都部分起作用。我想要做的就是从服务器端使用 InDesign 的母版页
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
我有一个带有完整设计页面的 xd adobe 链接。我想在 adobe xd windows 桌面应用程序中打开这些设计页面,但我不能。如何在 adobe xd windows 桌面应用程序中打开此链
activeDocument.fitArtboardToSelectedArt() 调用此命令时,AI 在 AI 5.1/6 32 位和 64 位版本上崩溃。我可以使用菜单中的命令。有没有人遇到过这个
activeDocument.fitArtboardToSelectedArt() 调用此命令时,AI 在 AI 5.1/6 32 位和 64 位版本上崩溃。我可以使用菜单中的命令。有没有人遇到过这个
如果可以,应该在哪里配置? 从文档中,所有提到的忽略文件都是关于从 SVN 提交 中排除 .vlt,但我们面临相反的问题 — 我们想排除来自 VLT 提交 的文件系统上的文件——例如.DS_Store
我正在 AdobeXD 中制作移动下拉菜单。 除了我的主页,我还有另外两个画板;菜单本身和一个按钮。 我想要做的就是触发菜单向下滑动,并将退出按钮覆盖在首先触发效果的按钮顶部。 它会覆盖退出按钮,
Javascript 的 setTimeout函数是window的一个方法目的。此对象在 ExtendScript 中不存在,因此不可用于为 Adobe InDesign 或 Illustrato
有人可能会争论它是否与摄影有关,但由于它与 DNG 格式有关,所以在这里问。 我正在尝试构建一个 Adobe DNG SDK,以便我能够将许多不同的相机原始格式转换为 *.dng 格式。 我为 h
我正在 Adobe CQ5.5 中开发一个自定义容器组件,我想要一个自定义消息作为占位符,而不是默认的“将组件或 Assets 拖到此处”。 到目前为止,我发现我必须添加 cq:emptyText
我想在导入 XML 时使用 Internet URL 将图像加载到 InDesign 模板中。 这可能吗?或者图片是否需要存储在本地机器上? 最佳答案 这可能吗?不需要。镜像需要存储在本地机器上吗?是
在 Adobe Edge Animate 中,如何获取 Symbol 的当前时间? 我混合使用 jQuery 和 Adobe Edge 代码来编程我的页面。我想检查一个符号的时间是否停留在第一
如果我将 adobe xd 文档放置在本地计算机上的任何位置。 示例:C:\doc\adobe-xd\brand\brand.xd 打开它并运行插件 是否可以检索 adobe xd 文档位置。 P.S
我正在使用 AEM 6.1 和 Maven 来管理依赖项。我可以看到 bundle com.adobe.granite.poi 版本 2.0.0 随 AEM 实例一起提供。但我似乎无法在 Adob
我正在使用 adobe labs magic selection 工具,但它要求用户进行 adobe 登录。有什么办法可以不让用户登录,但仍然使用 magic selection 工具?我听说过这个,
我们有 Adobe PDF writer,希望能够使用它而不是 ghostscript。 SaveAs() 函数是否锁定在 ghostscript 中,如果是,我该如何使用 adobe pdf w
我想知道 Adobe Experience Manager (AEM) 6.2/6.3 使用哪个版本的 Apache Sling?我在各种网站上进行了搜索,包括 Adobe 自己的文档,但似乎
还在努力探索动作剧本。有没有办法访问Android手机的接近感应器?想要使用传感器的输出关闭探测器。找到了里查多松/接近感应器(https://github.com/richardolsson/pro
我对 Day Cq5 还很陌生。我的对话框中有一个复选框,我想在用户选择或取消选择它时在我的 jsp 中检索它的 bool 值。请帮忙 最佳答案 如果要从组件的 JSP 中检索值,请执行以下操作: b
http://helpx.adobe.com/experience-manager/kb/HowToDefineComponentListDynamically.html 我在上面尝试过,但由于文章的
我是一名优秀的程序员,十分优秀!