|
1 | 1 | package com.tughi.aggregator.ion
|
2 | 2 |
|
3 |
| -import com.amazon.ion.IonWriter |
4 |
| -import com.amazon.ionelement.api.AnyElement |
5 | 3 | import com.amazon.ionelement.api.ElementType
|
6 | 4 | import com.amazon.ionelement.api.IonElement
|
7 |
| -import com.amazon.ionelement.api.MetaContainer |
8 | 5 | import com.amazon.ionelement.api.StructElement
|
9 |
| -import com.amazon.ionelement.api.StructField |
10 | 6 | import com.amazon.ionelement.api.location
|
11 | 7 | import com.amazon.ionelement.api.locationToString
|
12 | 8 |
|
13 |
| -abstract class CustomElement internal constructor(private val structElement: StructElement, validate: Boolean) : StructElement { |
| 9 | +abstract class CustomElement internal constructor(structElement: StructElement, validate: Boolean) : StructElement by structElement { |
14 | 10 | init {
|
15 | 11 | if (validate) {
|
16 | 12 | validate()
|
17 | 13 | }
|
18 | 14 | }
|
19 | 15 |
|
20 |
| - override val annotations: List<String> |
21 |
| - get() = structElement.annotations |
22 |
| - |
23 |
| - override val fields: Collection<StructField> |
24 |
| - get() = structElement.fields |
25 |
| - |
26 |
| - override val isNull: Boolean |
27 |
| - get() = structElement.isNull |
28 |
| - |
29 |
| - override val metas: MetaContainer |
30 |
| - get() = structElement.metas |
31 |
| - |
32 |
| - override val size: Int |
33 |
| - get() = structElement.size |
34 |
| - |
35 |
| - override val type: ElementType |
36 |
| - get() = structElement.type |
37 |
| - |
38 |
| - override val values: Collection<AnyElement> |
39 |
| - get() = structElement.values |
40 |
| - |
41 |
| - override fun asAnyElement() = structElement.asAnyElement() |
42 |
| - |
43 |
| - override fun containsField(fieldName: String) = structElement.containsField(fieldName) |
44 |
| - |
45 |
| - override fun copy(annotations: List<String>, metas: MetaContainer) = structElement.copy(annotations, metas) |
46 |
| - |
47 |
| - override fun get(fieldName: String) = structElement.get(fieldName) |
48 |
| - |
49 |
| - override fun getAll(fieldName: String) = structElement.getAll(fieldName) |
50 |
| - |
51 |
| - override fun getOptional(fieldName: String) = structElement.getOptional(fieldName) |
52 |
| - |
53 |
| - override fun toString() = structElement.toString() |
54 |
| - |
55 |
| - override fun withAnnotations(vararg additionalAnnotations: String) = structElement.withAnnotations(*additionalAnnotations) |
56 |
| - |
57 |
| - override fun withAnnotations(additionalAnnotations: Iterable<String>) = structElement.withAnnotations(additionalAnnotations) |
58 |
| - |
59 |
| - override fun withMeta(key: String, value: Any) = structElement.withMeta(key, value) |
60 |
| - |
61 |
| - override fun withMetas(additionalMetas: MetaContainer) = structElement.withMetas(additionalMetas) |
62 |
| - |
63 |
| - override fun withoutAnnotations() = structElement.withoutAnnotations() |
64 |
| - |
65 |
| - override fun withoutMetas() = structElement.withoutMetas() |
66 |
| - |
67 |
| - override fun writeTo(writer: IonWriter) = structElement.writeTo(writer) |
68 |
| - |
69 | 16 | abstract fun validate()
|
70 | 17 |
|
71 | 18 | protected fun checkAnnotation(annotation: String) {
|
|
0 commit comments