Changeset 1186


Ignore:
Timestamp:
07/25/06 12:59:26 (14 years ago)
Author:
curtis
Message:

OME-XML metadata store fundamentally works again.
Some set methods still need to be finished/fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/OMEXMLMetadataStore.java

    r1184 r1186  
    612612      if (children.get(i) != null) return (OMEXMLNode) children.get(i); 
    613613    } 
    614     // CTR TODO fix this, it is crap 
     614    String className; 
     615    Class param; 
     616    if (name.equals("CustomAttributes") || name.equals("Dataset") || 
     617      name.equals("Feature") || name.equals("Image") || name.equals("OME") || 
     618      name.equals("Project")) 
     619    { 
     620      className = "org.openmicroscopy.xml." + name + "Node"; 
     621      param = base.getClass(); 
     622    } 
     623    else { 
     624      className = "org.openmicroscopy.xml.st." + name + "Node"; 
     625      param = CustomAttributesNode.class; 
     626    } 
    615627    try { 
    616       Class c = Class.forName("org.openmicroscopy.xml.st." + name + "Node"); 
    617       Constructor con = c.getConstructor(new Class[] {OMEXMLNode.class}); 
     628      Class c = Class.forName(className); 
     629      Constructor con = c.getConstructor(new Class[] {param}); 
    618630      return (OMEXMLNode) con.newInstance(new Object[] {base}); 
    619631    } 
     
    623635 
    624636  /** 
    625    * Gets the value of the given attribute in the nth occurence of the 
     637   * Gets the value of the given attribute in the nth occurrence of the 
    626638   * specified node. 
    627639   * @param nodeName the name of the node to retrieve the value from 
Note: See TracChangeset for help on using the changeset viewer.