@Test public void testSetAll() { Properties props = new Properties(); props.put( TikaCoreProperties.FORMAT.getName(), "format" ); props.put( TikaCoreProperties.SUBJECT.getName(), "keyword" ); xmpMeta.setAll( props ); assertEquals( "format", xmpMeta.get( TikaCoreProperties.FORMAT ) ); String[] values = xmpMeta.getValues( TikaCoreProperties.SUBJECT); assertEquals( 1, values.length ); assertEquals( "keyword", values[0] ); }
@Override public void setAll(Properties properties) { @SuppressWarnings("unchecked") Enumeration<String> names = (Enumeration<String>) properties.propertyNames(); while (names.hasMoreElements()) { String name = names.nextElement(); Property property = Property.get( name ); if (property == null) { throw new PropertyTypeException( "Unknown property: " + name ); } String value = properties.getProperty( name ); if (property.isMultiValuePermitted()) { this.set( property, new String[] { value } ); } else { this.set( property, value ); } } }
XMPMetadata extends Metadata { @Override public void setAll(Properties properties) { @SuppressWarnings("unchecked") Enumeration<String> names = (Enumeration<String>) properties.propertyNames(); while (names.hasMoreElements()) { String name = names.nextElement(); Property property = Property.get( name ); if (property == null) { throw new PropertyTypeException( "Unknown property: " + name ); } String value = properties.getProperty( name ); if (property.isMultiValuePermitted()) { this.set( property, new String[] { value } ); } else { this.set( property, value ); } } } }
XMPMetadata extends Metadata { @Override public void setAll(Properties properties) { @SuppressWarnings("unchecked") Enumeration<String> names = (Enumeration<String>) properties.propertyNames(); while (names.hasMoreElements()) { String name = names.nextElement(); Property property = Property.get( name ); if (property == null) { throw new PropertyTypeException( "Unknown property: " + name ); } String value = properties.getProperty( name ); if (property.isMultiValuePermitted()) { this.set( property, new String[] { value } ); } else { this.set( property, value ); } } } XMPMetadata();  XMPMetadata(Metadata meta);  XMPMetadata(Metadata meta, String mimetype); }
XMPMetadata extends Metadata { @Override public void setAll(Properties properties) { @SuppressWarnings("unchecked") Enumeration<String> names = (Enumeration<String>) properties.propertyNames(); while (names.hasMoreElements()) { String name = names.nextElement(); Property property = Property.get( name ); if (property == null) { throw new PropertyTypeException( "Unknown property: " + name ); } String value = properties.getProperty( name ); if (property.isMultiValuePermitted()) { this.set( property, new String[] { value } ); } else { this.set( property, value ); } } } XMPMetadata();  XMPMetadata(Metadata meta);  XMPMetadata(Metadata meta, String mimetype); void process(Metadata meta); void process(Metadata meta, String mimetype); XMPMeta getXMPData(); static String registerNamespace(String namespaceURI, String suggestedPrefix); static String getNamespacePrefix(String namespaceURI); static String getNamespaceURI(String namespacePrefix); @SuppressWarnings("unchecked") static Map<String, String> getNamespaces(); @SuppressWarnings("unchecked") static Map<String, String> getPrefixes(); static void deleteNamespace(String namespaceURI); @Override boolean isMultiValued(Property property); @Override boolean isMultiValued(String name); @Override String[] names(); @Override String get(String name); @Override String get(Property property); @Override Integer getInt(Property property); @Override Date getDate(Property property); @Override String[] getValues(Property property); @Override String[] getValues(String name); @Override void add(String name, String value); @Override void set(String name, String value); @Override void set(Property property, String value); @Override void set(Property property, int value); @Override void set(Property property, double value); @Override void set(Property property, Date date); @Override void set(Property property, String[] values); @Override void setAll(Properties properties); void remove(Property property); @Override void remove(String name); @Override int size(); @Override boolean equals(Object o); @Override String toString(); }
XMPMetadata extends Metadata { @Override public void setAll(Properties properties) { @SuppressWarnings("unchecked") Enumeration<String> names = (Enumeration<String>) properties.propertyNames(); while (names.hasMoreElements()) { String name = names.nextElement(); Property property = Property.get( name ); if (property == null) { throw new PropertyTypeException( "Unknown property: " + name ); } String value = properties.getProperty( name ); if (property.isMultiValuePermitted()) { this.set( property, new String[] { value } ); } else { this.set( property, value ); } } } XMPMetadata();  XMPMetadata(Metadata meta);  XMPMetadata(Metadata meta, String mimetype); void process(Metadata meta); void process(Metadata meta, String mimetype); XMPMeta getXMPData(); static String registerNamespace(String namespaceURI, String suggestedPrefix); static String getNamespacePrefix(String namespaceURI); static String getNamespaceURI(String namespacePrefix); @SuppressWarnings("unchecked") static Map<String, String> getNamespaces(); @SuppressWarnings("unchecked") static Map<String, String> getPrefixes(); static void deleteNamespace(String namespaceURI); @Override boolean isMultiValued(Property property); @Override boolean isMultiValued(String name); @Override String[] names(); @Override String get(String name); @Override String get(Property property); @Override Integer getInt(Property property); @Override Date getDate(Property property); @Override String[] getValues(Property property); @Override String[] getValues(String name); @Override void add(String name, String value); @Override void set(String name, String value); @Override void set(Property property, String value); @Override void set(Property property, int value); @Override void set(Property property, double value); @Override void set(Property property, Date date); @Override void set(Property property, String[] values); @Override void setAll(Properties properties); void remove(Property property); @Override void remove(String name); @Override int size(); @Override boolean equals(Object o); @Override String toString();  }