org.alfresco.repo.content.metadata
Class MetadataExtracter.OverwritePolicy

java.lang.Object
  extended by java.lang.Enum
      extended by org.alfresco.repo.content.metadata.MetadataExtracter.OverwritePolicy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable
Enclosing interface:
MetadataExtracter

public static class MetadataExtracter.OverwritePolicy
extends java.lang.Enum

A enumeration of functional property overwrite policies. These determine whether extracted properties are written into the property map or not.

See Also:
Serialized Form

Field Summary
static MetadataExtracter.OverwritePolicy CAUTIOUS
          This policy only puts the extracted value if there is no value (null or otherwise) in the properties map.
static MetadataExtracter.OverwritePolicy EAGER
          This policy puts the new value if: the extracted property is not null
static MetadataExtracter.OverwritePolicy PRAGMATIC
          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
 
Method Summary
 java.util.Map applyProperties(java.util.Map extractedProperties, java.util.Map targetProperties)
          Apply the overwrite policy for the extracted properties.
static MetadataExtracter.OverwritePolicy valueOf(java.lang.String name)
           
static MetadataExtracter.OverwritePolicy[] values()
           
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EAGER

public static final MetadataExtracter.OverwritePolicy EAGER
This policy puts the new value if:


PRAGMATIC

public static final MetadataExtracter.OverwritePolicy PRAGMATIC
This policy puts the new value if:


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:

Method Detail

values

public static final MetadataExtracter.OverwritePolicy[] values()

valueOf

public static MetadataExtracter.OverwritePolicy valueOf(java.lang.String name)

applyProperties

public java.util.Map applyProperties(java.util.Map extractedProperties,
                                     java.util.Map targetProperties)
Apply the overwrite policy for the extracted properties.

Returns:
Returns a map of all properties that were applied to the target map. If the result is an empty map, then the target map remains unchanged.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.