]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/testcases/org/simantics/databoard/tests/TestArray.java
Update SCL-editor annotations asynchronously
[simantics/platform.git] / bundles / org.simantics.databoard / testcases / org / simantics / databoard / tests / TestArray.java
1 /*******************************************************************************
2  *  Copyright (c) 2010 Association for Decentralized Information Management in
3  *  Industry THTH ry.
4  *  All rights reserved. This program and the accompanying materials
5  *  are made available under the terms of the Eclipse Public License v1.0
6  *  which accompanies this distribution, and is available at
7  *  http://www.eclipse.org/legal/epl-v10.html
8  *
9  *  Contributors:
10  *      VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.databoard.tests;
13
14 import org.simantics.databoard.Datatypes;
15 import org.simantics.databoard.annotations.Length;
16 import org.simantics.databoard.annotations.Optional;
17 import org.simantics.databoard.annotations.Range;
18 import org.simantics.databoard.annotations.Referable;
19 import org.simantics.databoard.annotations.Unit;
20 import org.simantics.databoard.type.Datatype;
21
22 public @Referable class TestArray {
23         
24         @Length("5") int[] a;
25         
26         float[][][] b;
27         
28         TestArray[] c;
29         
30         @Unit("m") double length;
31         
32         static class ExampleClass {
33                 
34                 @Length({"320", "240"})
35                 int[][] image;
36                 
37                 @Range("[0..100]") double alpha;
38                                 
39                 @Optional
40                 @Unit("m")
41                 double length;          
42         }
43         
44         public static void main(String[] args) throws Exception {
45                 Datatype exampleDataType = Datatypes.getDatatype(ExampleClass.class);
46                 
47                 System.out.println(exampleDataType);
48                                 
49         }
50 }