Skip to content

Commit 79532df

Browse files
author
César Román
authored
feat(ia): add PerspectiveModule class (#71)
add supporting packages and classes Closes: #67
1 parent 95feac0 commit 79532df

File tree

11 files changed

+1090
-4
lines changed

11 files changed

+1090
-4
lines changed

src/com/inductiveautomation/ignition/common/__init__.py

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
from __future__ import print_function
22

3-
__all__ = ["AbstractDataset", "BasicDataset", "Dataset", "Path", "QualifiedPath"]
3+
__all__ = [
4+
"AbstractDataset",
5+
"BasicDataset",
6+
"Dataset",
7+
"JsonPath",
8+
"Path",
9+
"QualifiedPath",
10+
]
411

512
from typing import Any, List, Optional, Union
613

@@ -325,24 +332,85 @@ def __init__(self, *args):
325332
super(BasicDataset, self).__init__([""], [Class()])
326333

327334
def columnContainsNulls(self, col):
335+
# type: (int) -> bool
328336
pass
329337

330338
def datasetContainsNulls(self):
339+
# type: () -> bool
331340
pass
332341

333342
def getData(self):
343+
# type: () -> Any
334344
pass
335345

336346
def setAllDirectly(self, columnNames, columnTypes, data):
347+
# type: (List[String], List[Class], Any) -> None
337348
pass
338349

339350
def setDataDirectly(self, arg):
351+
# type: (Any) -> None
340352
pass
341353

342354
def setFromXML(self, columnNames, columnTypes, encodedData, rowCount):
355+
# type: (List[String], List[Class], String, int) -> None
343356
pass
344357

345358
def setValueAt(self, row, col, value):
359+
# type: (int, int, Any) -> None
360+
pass
361+
362+
363+
class JsonPath(Object):
364+
ROOT = None # type: JsonPath
365+
366+
def createChildPath(self, arg):
367+
# type: (Union[JsonPath, int, String]) -> JsonPath
368+
pass
369+
370+
def getAsLinkedList(self):
371+
# type: () -> Any
372+
pass
373+
374+
def getDepth(self):
375+
# type: () -> int
376+
pass
377+
378+
def getKey(self):
379+
# type: () -> Object
380+
pass
381+
382+
def getParent(self):
383+
# type: () -> JsonPath
384+
pass
385+
386+
def getPathElements(self):
387+
# type: () -> List[JsonPath]
388+
pass
389+
390+
def getSubPath(self, startingDepth):
391+
# type: (int) -> JsonPath
392+
pass
393+
394+
def isAncestorOf(self, element):
395+
# type: (JsonPath) -> bool
396+
pass
397+
398+
def isRelatedTo(self, other):
399+
# type: (JsonPath) -> bool
400+
pass
401+
402+
def isRoot(self):
403+
# type: () -> bool
404+
pass
405+
406+
@staticmethod
407+
def isValidIdentifier(test):
408+
# type: (String) -> bool
409+
pass
410+
411+
@staticmethod
412+
def parse(path):
413+
# type: (String) -> String
346414
pass
347415

348416

src/com/inductiveautomation/ignition/common/gson/__init__.py

Lines changed: 262 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,230 @@
11
from __future__ import print_function
22

3-
from typing import Any, Iterable, Optional, Union
3+
from typing import Any, Iterable, Optional, TypeVar, Union
44

5-
from java.lang import Object, String
5+
from com.inductiveautomation.ignition.common.gson.reflect import TypeToken
6+
from com.inductiveautomation.ignition.common.gson.stream import JsonReader, JsonWriter
7+
from java.io import Reader, Writer
8+
from java.lang import Class, Enum, Object, String
9+
10+
T = TypeVar("T")
11+
12+
13+
class ExclusionStrategy(object):
14+
def shouldSkipClass(self, clazz):
15+
# type: (Class) -> bool
16+
raise NotImplementedError
17+
18+
def shouldSkipField(self, attributes):
19+
# type: (FieldAttributes) -> bool
20+
raise NotImplementedError
21+
22+
23+
class FieldNamingStrategy(object):
24+
def translateName(self, arg):
25+
# type: (Any) -> String
26+
raise NotImplementedError
27+
28+
29+
class TypeAdapterFactory(object):
30+
def create(self, gson, token):
31+
# type: (Gson, TypeToken) -> TypeAdapter
32+
raise NotImplementedError
33+
34+
35+
class FieldAttributes(Object):
36+
def __init__(self, *args):
37+
# type: (Any) -> None
38+
pass
39+
40+
def getAnnotation(self, annotation):
41+
# type: (Class) -> T
42+
pass
43+
44+
def getAnnotations(self):
45+
# type: () -> Iterable[Any]
46+
pass
47+
48+
def getDeclaredClass(self):
49+
# type: () -> Class
50+
pass
51+
52+
def getDeclaredType(self):
53+
# type: () -> Any
54+
pass
55+
56+
def getDeclaringClass(self):
57+
# type: () -> Class
58+
pass
59+
60+
def getName(self):
61+
# type: () -> String
62+
pass
63+
64+
def hasModifier(self, modifier):
65+
# type: (int) -> bool
66+
pass
67+
68+
def isSynthetic(self):
69+
# type: () -> bool
70+
pass
71+
72+
73+
class FieldNamingPolicy(Enum, FieldNamingStrategy):
74+
IDENTITY = None # type: String
75+
UPPER_CAMEL_CASE = None # type: String
76+
UPPER_CAMEL_CASE_WITH_SPACES = None # type: String
77+
LOWER_CASE_WITH_UNDERSCORES = None # type: String
78+
LOWER_CASE_WITH_DASHES = None # type: String
79+
LOWER_CASE_WITH_DOTS = None # type: String
80+
81+
def translateName(self, arg):
82+
# type: (Any) -> String
83+
pass
84+
85+
86+
class Gson(Object):
87+
def excluder(self):
88+
# type: () -> Any
89+
pass
90+
91+
def fieldNamingStrategy(self):
92+
# type: () -> FieldNamingStrategy
93+
pass
94+
95+
def fromJson(self, *args):
96+
# type: (Any) -> T
97+
pass
98+
99+
def getAdapter(self, TypeToken=None):
100+
# type: (TypeToken) -> TypeAdapter
101+
pass
102+
103+
def getDelegateAdapter(self, skipPast, type):
104+
# type: (TypeAdapterFactory, TypeToken) -> TypeAdapter
105+
pass
106+
107+
def htmlSafe(self):
108+
# type: () -> bool
109+
pass
110+
111+
def newBuilder(self):
112+
# type: () -> GsonBuilder
113+
pass
114+
115+
def newJsonReader(self, reader):
116+
# type: (Reader) -> JsonReader
117+
pass
118+
119+
def newJsonWriter(self, writer):
120+
# type: (Writer) -> JsonWriter
121+
pass
122+
123+
def serializeNulls(self):
124+
# type: () -> bool
125+
pass
126+
127+
def toJson(self, *args):
128+
# type: (Any) -> Optional[String]
129+
pass
130+
131+
def toJsonTree(self, src, typeOfSrc=None):
132+
# type: (Object, Any) -> JsonElement
133+
pass
134+
135+
136+
class GsonBuilder(object):
137+
def __init__(self, *args):
138+
# type: (Any) -> None
139+
pass
140+
141+
def addDeserializationExclusionStrategy(self, strategy):
142+
# type: (ExclusionStrategy) -> GsonBuilder
143+
pass
144+
145+
def addSerializationExclusionStrategy(self, strategy):
146+
# type: (ExclusionStrategy) -> GsonBuilder
147+
pass
148+
149+
def create(self):
150+
# type: () -> Gson
151+
pass
152+
153+
def disableHtmlEscaping(self):
154+
# type: () -> GsonBuilder
155+
pass
156+
157+
def disableInnerClassSerialization(self):
158+
# type: () -> GsonBuilder
159+
pass
160+
161+
def enableComplexMapKeySerialization(self):
162+
# type: () -> GsonBuilder
163+
pass
164+
165+
def excludeFieldsWithoutExposeAnnotation(self):
166+
# type: () -> GsonBuilder
167+
pass
168+
169+
def excludeFieldsWithModifiers(self, *args):
170+
# type: (int) -> GsonBuilder
171+
pass
172+
173+
def generateNonExecutableJson(self):
174+
# type: () -> GsonBuilder
175+
pass
176+
177+
def setLenient(self):
178+
# type: () -> GsonBuilder
179+
pass
180+
181+
def registerTypeAdapter(self, type, typeAdapter):
182+
# type: (Any, Object) -> GsonBuilder
183+
pass
184+
185+
def registerTypeAdapterFactory(self, factory):
186+
# type: (TypeAdapterFactory) -> GsonBuilder
187+
pass
188+
189+
def registerTypeHierarchyAdapter(self, baseType, typeAdapter):
190+
# type: (Class, Object) -> GsonBuilder
191+
pass
192+
193+
def serializeNulls(self):
194+
# type: () -> GsonBuilder
195+
pass
196+
197+
def serializeSpecialFloatingPointValues(self):
198+
# type: () -> GsonBuilder
199+
pass
200+
201+
def setDateFormat(self, *args):
202+
# type: (Any) -> GsonBuilder
203+
pass
204+
205+
def setExclusionStrategies(self, *args):
206+
# type: (ExclusionStrategy) -> GsonBuilder
207+
pass
208+
209+
def setFieldNamingPolicy(self, namingConvention):
210+
# type: (FieldNamingPolicy) -> GsonBuilder
211+
pass
212+
213+
def setFieldNamingStrategy(self, fieldNamingStrategy):
214+
# type: (FieldNamingStrategy) -> GsonBuilder
215+
pass
216+
217+
def setLongSerializationPolicy(self, policy):
218+
# type: (LongSerializationPolicy) -> GsonBuilder
219+
pass
220+
221+
def setPrettyPrinting(self):
222+
# type: () -> GsonBuilder
223+
pass
224+
225+
def setVersion(self, ignoreVersionsAfter):
226+
# type: (float) -> GsonBuilder
227+
pass
6228

7229

8230
class JsonElement(object):
@@ -367,3 +589,41 @@ def isIntegral(primitive):
367589
def isString(self):
368590
# type: () -> bool
369591
pass
592+
593+
594+
class LongSerializationPolicy(object):
595+
DEFAULT = None # type: JsonElement
596+
STRING = None # type: JsonElement
597+
598+
def serialize(self, arg):
599+
# type: (long) -> JsonElement
600+
raise NotImplementedError
601+
602+
603+
class TypeAdapter(object):
604+
def fromJson(self, arg):
605+
# type: (Union[Reader, String]) -> T
606+
pass
607+
608+
def fromJsonTree(self, jsonTree):
609+
# type: (JsonElement) -> T
610+
pass
611+
612+
def nullSafe(self):
613+
# type: () -> TypeAdapter
614+
pass
615+
616+
def read(self, reader):
617+
# type: (JsonReader) -> T
618+
raise NotImplementedError
619+
620+
def toJson(self, out, value):
621+
# type: (Writer, T) -> Optional[String]
622+
pass
623+
624+
def toJsonTree(self, value):
625+
# type: (T) -> JsonElement
626+
pass
627+
628+
def write(self, *args):
629+
raise NotImplementedError
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from typing import Any
2+
3+
from java.lang import Object
4+
5+
6+
class TypeToken(Object):
7+
@staticmethod
8+
def get(type):
9+
# type: (Any) -> TypeToken
10+
pass
11+
12+
@staticmethod
13+
def getArray(componentType):
14+
# type: (Any) -> TypeToken
15+
pass
16+
17+
@staticmethod
18+
def getParameterized(*args):
19+
# type: (Any) -> TypeToken
20+
pass

0 commit comments

Comments
 (0)