1 package org.melati.poem.test;
2
3 import java.util.Enumeration;
4
5 import org.melati.poem.AccessPoemException;
6 import org.melati.poem.ColumnInfo;
7 import org.melati.poem.NullTypeMismatchPoemException;
8 import org.melati.poem.ParsingPoemException;
9 import org.melati.poem.PoemException;
10 import org.melati.poem.PoemType;
11 import org.melati.poem.TypeMismatchPoemException;
12 import org.melati.poem.ValidationPoemException;
13 import org.melati.poem.PoemLocale;
14
15
16
17
18
19
20 public class NonSQLPoemType implements PoemType<Object> {
21
22
23
24
25
26 public void assertValidCooked(Object cooked) throws TypeMismatchPoemException, ValidationPoemException {
27 assertValidRaw(cooked);
28
29 }
30
31
32
33
34
35 public void assertValidRaw(Object raw) throws TypeMismatchPoemException, ValidationPoemException {
36 if (raw == null)
37 throw new NullTypeMismatchPoemException(this);
38 else
39 throw new TypeMismatchPoemException(raw, this);
40 }
41
42 @Override
43 public <O> PoemType<O> canRepresent(PoemType<O> other) {
44 return null;
45 }
46
47
48
49
50
51 public Object cookedOfRaw(Object raw) throws TypeMismatchPoemException, PoemException {
52 if (raw == null)
53 throw new NullTypeMismatchPoemException(this);
54 else
55 throw new TypeMismatchPoemException(raw, this);
56 }
57
58
59
60
61
62 public boolean getNullable() {
63 return false;
64 }
65
66
67
68
69
70 public Enumeration<Object> possibleRaws() {
71 return null;
72 }
73
74
75
76
77
78 public Object rawOfCooked(Object cooked) throws TypeMismatchPoemException {
79 if (cooked == null)
80 throw new NullTypeMismatchPoemException(this);
81 else
82 throw new TypeMismatchPoemException(cooked, this);
83 }
84
85
86
87
88
89 public Object rawOfString(String rawString) throws ParsingPoemException, ValidationPoemException {
90 return null;
91 }
92
93
94
95
96
97 public void saveColumnInfo(ColumnInfo columnInfo) throws AccessPoemException {
98 }
99
100
101
102
103
104 public String stringOfCooked(Object cooked, PoemLocale locale, int style)
105 throws TypeMismatchPoemException, PoemException {
106 return null;
107 }
108
109
110
111
112
113 public String stringOfRaw(Object raw) throws TypeMismatchPoemException, ValidationPoemException {
114 return null;
115 }
116
117
118
119
120
121 public String toDsdType() {
122 return null;
123 }
124
125
126
127
128
129 public PoemType<Object> withNullable(boolean nullable) {
130 return null;
131 }
132
133 }