Ignore:
Timestamp:
04/11/08 15:56:39 (12 years ago)
Author:
curtis
Message:

A bunch of work on the loci.formats.meta autogenerator. Not finished yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/auto/FilterMetadata.vm

    r3617 r3917  
    4444 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/loci/formats/meta/FilterMetadata.java">SVN</a></dd></dl> 
    4545 * 
     46 * @author Melissa Linkert linkert at wisc.edu 
     47 * @author Curtis Rueden ctrueden at wisc.edu 
    4648 */ 
    4749public class FilterMetadata implements MetadataStore { 
     
    4951  // -- Fields -- 
    5052 
    51   private MetadataStore delegate; 
     53  private MetadataStore store; 
    5254  private boolean filter; 
    5355 
    5456  // -- Constructor -- 
    5557 
    56   public FilterMetadata(MetadataStore delegate, boolean filter) { 
    57     this.delegate = delegate; 
     58  public FilterMetadata(MetadataStore store, boolean filter) { 
     59    this.store = store; 
    5860    this.filter = filter; 
    5961  } 
     
    6264 
    6365  public void createRoot() { 
    64     delegate.createRoot(); 
     66    store.createRoot(); 
    6567  } 
    6668 
    6769  public Object getRoot() { 
    68     return delegate.getRoot(); 
     70    return store.getRoot(); 
    6971  } 
    7072 
    7173  public void setRoot(Object root) { 
    72     delegate.setRoot(root); 
     74    store.setRoot(root); 
    7375  } 
    7476 
    75 #foreach ($entity in $entities) 
     77#foreach ($entity in $q.entities()) 
     78#set ($dummy = $q.setEntity($entity)) 
    7679 
    77   // -- $entity.name() property storage - 
    78 #foreach ($prop in $entity.props()) 
     80  // -- $entity property storage - 
     81#foreach ($prop in $q.props()) 
     82#set ($dummy = $q.setProperty($prop)) 
    7983 
    80   /* @see MetadataStore#set$entity.name()$prop.name()($prop.type(true), $entity.indicesList(true, false)) */ 
    81   public void set$entity.name()$prop.name()($prop.type(true) $prop.varName(), $entity.indicesList(true, true)) { 
    82 #if ($prop.type(true) == "String") 
    83     String temp = filter ? DataTools.sanitize($prop.varName()) : $prop.varName(); 
    84     delegate.set$entity.name()$prop.name()(temp, $entity.indicesList(false, true)); 
     84  /* @see MetadataStore#set$entity$prop($q.type(), $q.indicesList(true, false)) */ 
     85  public void set$entity$prop($q.type() $q.var($prop), $q.indicesList(true, true)) { 
     86#if ($q.type() == "String") 
     87    String value = filter ? DataTools.sanitize($q.var($prop)) : $q.var($prop); 
     88    store.set$entity$prop(value, $q.indicesList(false, true)); 
    8589#else 
    86     delegate.set$entity.name()$prop.name()($prop.varName(), $entity.indicesList(false, true)); 
     90    store.set$entity$prop($q.var($prop), $q.indicesList(false, true)); 
    8791#end 
    8892  } 
Note: See TracChangeset for help on using the changeset viewer.