source: branches/maven/components/autogen/src/ice/IMetadataI.vm @ 6516

Revision 6516, 4.4 KB checked in by melissa, 9 years ago (diff)

Eliminated several deprecation warnings.

Line 
1//
2// IMetadataI.java
3//
4
5/*
6OME Bio-Formats package for reading and converting biological file formats.
7Copyright (C) 2005-@year@ UW-Madison LOCI and Glencoe Software, Inc.
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22*/
23
24/*-----------------------------------------------------------------------------
25 *
26 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY.
27 * Created by $user via MetadataAutogen on $timestamp
28 *
29 *-----------------------------------------------------------------------------
30 */
31
32package loci.ice.formats;
33
34import Ice.Current;
35import loci.common.services.DependencyException;
36import loci.common.services.ServiceException;
37import loci.common.services.ServiceFactory;
38import loci.formats.MetadataTools;
39import loci.formats.meta.IMetadata;
40import loci.formats.services.OMEXMLService;
41
42import ome.xml.model.enums.*;
43import ome.xml.model.primitives.*;
44
45/**
46 * Server-side Ice wrapper for client/server
47 * {@link loci.formats.meta.IMetadata} objects.
48 *
49 * <dl><dt><b>Source code:</b></dt>
50 * <dd><a href="https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/bio-formats-ice/src/loci/ice/formats/IMetadataI.java">Trac</a>,
51 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/bio-formats-ice/src/loci/ice/formats/IMetadataI.java">SVN</a></dd></dl>
52 *
53 * @author Hidayath Ansari mansari at wisc.edu
54 * @author Curtis Rueden ctrueden at wisc.edu
55 */
56public class IMetadataI extends _IMetadataDisp {
57
58  // -- Fields --
59
60  private IMetadata metadataObject;
61  private OMEXMLService service;
62
63  // -- Constructor --
64
65  public IMetadataI() {
66    try {
67      ServiceFactory factory = new ServiceFactory();
68      service = factory.getInstance(OMEXMLService.class);
69      metadataObject = service.createOMEXMLMetadata();
70    }
71    catch (DependencyException de) { }
72    catch (ServiceException se) { }
73  }
74
75  // -- IMetadataI methods --
76
77  public loci.formats.meta.IMetadata getWrappedObject() {
78    return metadataObject;
79  }
80
81  public void setMetadataObject(loci.formats.meta.IMetadata meta) {
82    metadataObject = meta;
83  }
84
85  // -- MetadataRetrieve methods --
86
87  public String getOMEXML(Current current) {
88    try {
89      return service.getOMEXML(metadataObject);
90    }
91    catch (ServiceException se) { }
92    return null;
93  }
94
95  // - Entity counting -
96#foreach ($entity in $q.entities())
97#set ($dummy = $q.setEntity($entity))
98#if ($q.countable())
99#set ($args = $q.argsList($q.chop()))
100#if ($args == "")
101#set ($args = "Current current")
102#else
103#set ($args = $args + ", Current current")
104#end##if $args == ""
105
106  public int get${entity}Count($args) {
107    return metadataObject.get${entity}Count($q.varsList($q.chop()));
108  }
109#end###if countable
110#end##foreach $entity
111
112  // - Entity retrieval -
113
114  public String getUUID(Current current) {
115    return metadataObject.getUUID();
116  }
117#foreach ($entity in $q.entities())
118#set ($dummy = $q.setEntity($entity))
119
120  // - $entity property retrieval -
121#foreach ($prop in $q.props())
122#set ($dummy = $q.setProperty($prop))
123
124  public $q.primitive($q.type()) get$entity$prop($q.argsList(), Current current) {
125    return metadataObject.get$entity$prop($q.varsList());
126  }
127#end##foreach $prop
128#end##foreach $entity
129
130  // -- MetadataStore methods --
131
132  public void createRoot(Current current) {
133    metadataObject.createRoot();
134  }
135
136  // - Entity storage -
137
138  public void setUUID(String uuid, Current current) {
139    metadataObject.setUUID(uuid);
140  }
141#foreach ($entity in $q.entities())
142#set ($dummy = $q.setEntity($entity))
143
144  // - $entity property storage -
145#foreach ($prop in $q.props())
146#set ($dummy = $q.setProperty($prop))
147
148  public void set$entity$prop($q.primitive($q.type()) $q.var($prop), $q.argsList(), Current current) {
149    metadataObject.set$entity$prop($q.var($prop), $q.varsList());
150  }
151#end##foreach $prop
152#end##foreach $entity
153
154}
Note: See TracBrowser for help on using the repository browser.