Enum MetadataExtracter.OverwritePolicy
- java.lang.Object
-
- java.lang.Enum<MetadataExtracter.OverwritePolicy>
-
- org.alfresco.repo.content.metadata.MetadataExtracter.OverwritePolicy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<MetadataExtracter.OverwritePolicy>
- Enclosing interface:
- MetadataExtracter
@AlfrescoPublicApi public static enum MetadataExtracter.OverwritePolicy extends java.lang.Enum<MetadataExtracter.OverwritePolicy>
A enumeration of functional property overwrite policies. These determine whether extracted properties are written into the property map or not.- Author:
- Derek Hulley, Jesper Steen Møller
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CAUTIOUSThis policy only puts the extracted value if there is no value (null or otherwise) in the properties map.EAGERThis policy puts the new value if: the extracted property is not null null extracted values are return in the 'modified' map.PRAGMATICThis policy puts the new value if: the extracted property is not null either: there is no target key for the property the target value is null the string representation of the target value is an empty string or: the extracted property is a media related one (eg Image, Audio or Video) null extracted values are return in the 'modified' map.PRUDENTThis policy puts the new value if: the extracted property is not null there is no target key for the property the target value is null the string representation of the target value is an empty string null extracted values are return in the 'modified' map.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>applyProperties(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> extractedProperties, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> targetProperties)Apply the overwrite policy for the extracted properties.static MetadataExtracter.OverwritePolicyvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MetadataExtracter.OverwritePolicy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
EAGER
public static final MetadataExtracter.OverwritePolicy EAGER
This policy puts the new value if:- the extracted property is not null
-
PRAGMATIC
public static final MetadataExtracter.OverwritePolicy PRAGMATIC
This policy puts the new value if:- the extracted property is not null
- either:
- there is no target key for the property
- the target value is null
- the string representation of the target value is an empty string
- the extracted property is a media related one (eg Image, Audio or Video)
-
PRUDENT
public static final MetadataExtracter.OverwritePolicy PRUDENT
This policy puts the new value if:- the extracted property is not null
- there is no target key for the property
- the target value is null
- the string representation of the target value is an empty string
-
CAUTIOUS
public static final MetadataExtracter.OverwritePolicy CAUTIOUS
This policy only puts the extracted value if there is no value (null or otherwise) in the properties map. It is assumed that the mere presence of a property key is enough to inidicate that the target property is as intented. This policy puts the new value if:- the extracted property is not null
- there is no target key for the property
-
-
Method Detail
-
values
public static MetadataExtracter.OverwritePolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MetadataExtracter.OverwritePolicy c : MetadataExtracter.OverwritePolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MetadataExtracter.OverwritePolicy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
applyProperties
public java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> applyProperties(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> extractedProperties, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> targetProperties)Apply the overwrite policy for the extracted properties.- Returns:
- Returns a map of all properties that were applied to the target map as well as any null values that weren't applied but were present.
-
-