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/AggregateMetadata.vm

    r3605 r3917  
    9494 
    9595  // - Entity counting - 
    96 #foreach ($entity in $entities) 
    97 #if ($entity.countable()) 
     96#foreach ($entity in $q.entities()) 
     97#set ($dummy = $q.setEntity($entity)) 
     98#if ($q.countable()) 
    9899 
    99   /* @see MetadataRetrieve#get$entity.name()Count($entity.indicesList(true, false, false)) */ 
    100   public int get$entity.name()Count($entity.indicesList(true, true, false)) { 
     100  /* @see MetadataRetrieve#get${entity}Count($q.indicesList(true, false, false)) */ 
     101  public int get${entity}Count($q.indicesList(true, true, false)) { 
    101102    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
    102103      Object o = iter.next(); 
    103104      if (o instanceof MetadataRetrieve) { 
    104105        MetadataRetrieve retrieve = (MetadataRetrieve) o; 
    105         int result = retrieve.get$entity.name()Count($entity.indicesList(false, true, false)); 
     106        int result = retrieve.get${entity}Count($q.indicesList(false, true, false)); 
    106107        if (result >= 0) return result; 
    107108      } 
     
    113114 
    114115  // - Entity retrieval - 
    115 #foreach ($entity in $entities) 
     116#foreach ($entity in $q.entities()) 
     117#set ($dummy = $q.setEntity($entity)) 
    116118 
    117   /* @see MetadataRetrieve#get$entity.name()($entity.indicesList(true, false)) */ 
    118   public Object get$entity.name()($entity.indicesList(true, true)) { 
     119  // - $entity property retrieval - 
     120#foreach ($prop in $q.props()) 
     121#set ($dummy = $q.setProperty($prop)) 
     122 
     123  /* @see MetadataRetrieve#get$entity$prop($q.indicesList(true, false)) */ 
     124  public $q.type() get$entity$prop($q.indicesList(true, true)) { 
    119125    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
    120126      Object o = iter.next(); 
    121127      if (o instanceof MetadataRetrieve) { 
    122128        MetadataRetrieve retrieve = (MetadataRetrieve) o; 
    123         Object result = retrieve.get$entity.name()($entity.indicesList(false, true)); 
    124         if (result != null) return result; 
    125       } 
    126     } 
    127     return null; 
    128   } 
    129 #end##foreach $entity 
    130 #foreach ($entity in $entities) 
    131  
    132   // - $entity.name() property retrieval - 
    133 #foreach ($prop in $entity.props()) 
    134  
    135   /* @see MetadataRetrieve#get$entity.name()$prop.name()($entity.indicesList(true, false)) */ 
    136   public $prop.type(true) get$entity.name()$prop.name()($entity.indicesList(true, true)) { 
    137     for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
    138       Object o = iter.next(); 
    139       if (o instanceof MetadataRetrieve) { 
    140         MetadataRetrieve retrieve = (MetadataRetrieve) o; 
    141         $prop.type(true) result = retrieve.get$entity.name()$prop.name()($entity.indicesList(false, true)); 
     129        $q.type() result = retrieve.get$entity$prop($q.indicesList(false, true)); 
    142130        if (result != null) return result; 
    143131      } 
     
    177165      "Use getDelegates() and setRoot()."); 
    178166  } 
    179 #foreach ($entity in $entities) 
     167#foreach ($entity in $q.entities()) 
     168#set ($dummy = $q.setEntity($entity)) 
    180169 
    181   // - $entity.name() property storage - 
    182 #foreach ($prop in $entity.props()) 
     170  // - $entity property storage - 
     171#foreach ($prop in $q.props()) 
     172#set ($dummy = $q.setProperty($prop)) 
    183173 
    184   /* @see MetadataStore#set$entity.name()$prop.name()($prop.type(true), $entity.indicesList(true, false)) */ 
    185   public void set$entity.name()$prop.name()($prop.type(true) $prop.varName(), $entity.indicesList(true, true)) { 
     174  /* @see MetadataStore#set$entity$prop($q.type(), $q.indicesList(true, false)) */ 
     175  public void set$entity$prop($q.type() $q.var($prop), $q.indicesList(true, true)) { 
    186176    for (Iterator iter = delegates.iterator(); iter.hasNext();) { 
    187177      Object o = iter.next(); 
    188178      if (o instanceof MetadataStore) { 
    189179        MetadataStore store = (MetadataStore) o; 
    190         store.set$entity.name()$prop.name()($prop.varName(), $entity.indicesList(false, true)); 
     180        store.set$entity$prop($q.var($prop), $q.indicesList(false, true)); 
    191181      } 
    192182    } 
Note: See TracChangeset for help on using the changeset viewer.