org.javagen.agile.core.visitor
Class IdOverrideVisitor
java.lang.Object
org.javagen.agile.core.visitor.DefaultVisitor
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IdOverrideVisitor
public IdOverrideVisitor()
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.