org.javagen.agile.core.visitor
Class IdOverrideVisitor

java.lang.Object
  extended by org.javagen.agile.core.visitor.DefaultVisitor
      extended by org.javagen.agile.core.visitor.IdOverrideVisitor
All Implemented Interfaces:
Generator, Visit, Visitor

public class IdOverrideVisitor
extends DefaultVisitor

Takes two model trees and sets all the non-null values of one (ie customizingModels) onto the equivalent instances of the other (ie input parameter on gen method) using the copyTo method. Instances are matched by ID using an index (usually) stored in the root node. Visitors are available to both generate IDs and build the index prior to calling this generator.

Author:
Richard Easterling

Field Summary
 
Fields inherited from class org.javagen.agile.core.visitor.DefaultVisitor
itinerary
 
Constructor Summary
IdOverrideVisitor()
           
 
Method Summary
 Model gen(Model input)
          Entry point for generation task.
 Model getCustomizingModels()
           
 String getIdPrefixFilter()
           
 Map<String,Model> getIndex()
           
 boolean isIgnoreUnboundMetadata()
           
 void setCustomizingModels(Model customizedModels)
           
 void setIdPrefixFilter(String idPrefixFilter)
           
 void setIgnoreUnboundMetadata(boolean ignoreUnboundMetadata)
           
 void setIndex(Map<String,Model> index)
           
 void visit(Model model)
          Called to perform a specific process on a model instance.
 
Methods inherited from class org.javagen.agile.core.visitor.DefaultVisitor
getItinerary, itinerary, setItinerary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdOverrideVisitor

public IdOverrideVisitor()
Method Detail

gen

public Model gen(Model input)
Description copied from interface: Generator
Entry point for generation task.

Specified by:
gen in interface Generator
Overrides:
gen in class DefaultVisitor
Parameters:
input - the model instance to generate on - parent nodes will be ignored.
Returns:
the result of the task - usualy the same as the input model.

visit

public void visit(Model model)
Description copied from interface: Visit
Called to perform a specific process on a model instance.

Specified by:
visit in interface Visit
Specified by:
visit in interface Visitor
Overrides:
visit in class DefaultVisitor
Parameters:
model - instance to visit.

getCustomizingModels

public Model getCustomizingModels()

setCustomizingModels

public void setCustomizingModels(Model customizedModels)

getIndex

public Map<String,Model> getIndex()

setIndex

public void setIndex(Map<String,Model> index)

getIdPrefixFilter

public String getIdPrefixFilter()

setIdPrefixFilter

public void setIdPrefixFilter(String idPrefixFilter)

isIgnoreUnboundMetadata

public boolean isIgnoreUnboundMetadata()

setIgnoreUnboundMetadata

public void setIgnoreUnboundMetadata(boolean ignoreUnboundMetadata)


Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.