/
ITypes.java
131 lines (114 loc) · 3.9 KB
/
ITypes.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
* ome.api.ITypes
*
* Copyright 2006 University of Dundee. All rights reserved.
* Use is subject to license terms supplied in LICENSE.txt
*/
package ome.api;
// Java imports
import java.util.List;
import java.util.Map;
import ome.annotations.NotNull;
import ome.annotations.Validate;
import ome.conditions.ApiUsageException;
import ome.model.IAnnotated;
import ome.model.IEnum;
/**
* Access to reflective type information. Also provides simplified access to
* special types like enumerations.
*
* @author Josh Moore <a
* href="mailto:josh.moore@gmx.de">josh.moore@gmx.de</a>
* @version 3.0 <small> (<b>Internal version:</b> $$) </small>
* @since OMERO3
*/
public interface ITypes extends ServiceInterface {
/**
* Returns a list of classes which implement {@link IAnnotated}. These can
* be used in combination with {@link ome.api.Search}.
*
* @return
*/
List<Class<IAnnotated>> getAnnotationTypes();
<T extends IEnum> T createEnumeration(T newEnum);
<T extends IEnum> List<T> allEnumerations(Class<T> k);
/**
* lookup an enumeration value. As with the get-methods of {@link IQuery}
* queries returning no results will through an exception.
*
* @param <T>
* The type of the enumeration. Must extend {@link IEnum}
* @param k
* An enumeration class which should be searched.
* @param string
* The value for which an enumeration should be found.
* @return A managed enumeration. Never null.
* @throws ApiUsageException
* if {@link IEnum} is not found.
*/
<T extends IEnum> T getEnumeration(Class<T> k, String string);
/**
* updates enumeration value specified by object
*
* @param <T>
* The type of the enumeration. Must extend {@link IEnum}
* @param oEnum
* An enumeration object which should be searched.
* @return A managed enumeration. Never null.
*/
<T extends IEnum> T updateEnumeration(@NotNull
T oEnum);
/**
* updates enumeration value specified by object
*
* @param <T>
* The type of the enumeration. Must extend {@link IEnum}
* @param listEnum
* An enumeration collection of objects which should be searched.
* @return A managed enumeration. Never null.
*/
<T extends IEnum> void updateEnumerations(@NotNull
@Validate(IEnum.class)
List<T> listEnum);
/**
* deletes enumeration value specified by object
*
* @param <T>
* The type of the enumeration. Must extend {@link IEnum}
* @param oEnum
* An enumeration object which should be searched.
*/
<T extends IEnum> void deleteEnumeration(@NotNull
T oEnum);
/**
* Gets all original values.
*
* @param <T>
* The type of the enumeration. Must extend {@link IEnum}
* @return A list of managed enumerations.
* @throws RuntimeException
* if xml parsing failure.
*/
<T extends IEnum> List<T> getOriginalEnumerations();
<T extends IEnum> void resetEnumerations(Class<T> klass);
/**
* Gets all metadata classes which are IEnum type.
*
* @param <T>
* The type of the enumeration. Must extend {@link IEnum}
* @return list of Class of T extends IEnum
* @throws RuntimeException
* if Class not found.
*/
<T extends IEnum> List<Class<T>> getEnumerationTypes();
/**
* Gets all metadata classes which are IEnum type with contained objects.
*
* @param <T>
* The type of the enumeration. Must extend {@link IEnum}
* @return list of Class of T extends IEnum
* @throws RuntimeException
* if xml parsing failure.
*/
<T extends IEnum> Map<Class<T>, List<T>> getEnumerationsWithEntries();
}