com.atlassian.studio.confluence.importexport
Class AbstractPrimitivePropertyImportPreProcessor

java.lang.Object
  extended by com.atlassian.studio.confluence.importexport.AbstractPrimitivePropertyImportPreProcessor
All Implemented Interfaces:
ImportedObjectPreProcessor
Direct Known Subclasses:
AbstractBandanaImportPreProcessor, PermissionsImportPreProcessor, SpaceImportPreProcessor, SpaceTypeImportPreProcessor

public abstract class AbstractPrimitivePropertyImportPreProcessor
extends Object
implements ImportedObjectPreProcessor

An abstract pre-processor for handling PrimitiveProperty property objects. Sub-classes do the actual processing of ImportedObjects.


Constructor Summary
AbstractPrimitivePropertyImportPreProcessor()
           
 
Method Summary
protected abstract  List<String> getPropertyNames()
          Provides a list of names of properties that the pre-processor is targeting for processing.
abstract  boolean handles(ImportedObject importedObject)
           
 ImportedObject process(ImportedObject object)
          Takes an ImportedObject and returns a new, processed ImportedObject, or null if the ImportedObject should be skipped.
protected  Map<String,PrimitiveProperty> propertiesMatchingNames(List<ImportedProperty> properties, List<String> propertyNames)
          Finds the properties, if any, that need to be processed according to a list of names passed in.
protected abstract  PrimitiveProperty updateProperty(PrimitiveProperty primitiveProperty)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPrimitivePropertyImportPreProcessor

public AbstractPrimitivePropertyImportPreProcessor()
Method Detail

propertiesMatchingNames

protected Map<String,PrimitiveProperty> propertiesMatchingNames(List<ImportedProperty> properties,
                                                                List<String> propertyNames)
Finds the properties, if any, that need to be processed according to a list of names passed in. Only one property should match each provided name. If multiple are found, there is no guarantee fo which will be returned.

Parameters:
propertyNames - The list of names of properties that should be processed
Returns:
A map of Names to Properties. Returns an empty map if none found.

process

public ImportedObject process(ImportedObject object)
Description copied from interface: ImportedObjectPreProcessor
Takes an ImportedObject and returns a new, processed ImportedObject, or null if the ImportedObject should be skipped. This method will not execute unless ImportedObjectPreProcessor.handles(ImportedObject) returns true

Specified by:
process in interface ImportedObjectPreProcessor
Parameters:
object - The object that needs to be processed
Returns:
An ImportedObject with the relevant changes, or null if the object should not be imported.

getPropertyNames

protected abstract List<String> getPropertyNames()
Provides a list of names of properties that the pre-processor is targeting for processing. There should only be one property in the object for each of the names in the returned list.

Returns:
A list of names that the pre-processor should be targeting

updateProperty

protected abstract PrimitiveProperty updateProperty(PrimitiveProperty primitiveProperty)

handles

public abstract boolean handles(ImportedObject importedObject)
Specified by:
handles in interface ImportedObjectPreProcessor
Parameters:
importedObject - The object to be processed
Returns:
true if this preprocessor should be applied to the object, otherwise false.


Copyright © 2003–2015 Atlassian. All rights reserved.