View Javadoc
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   * @author timp
17   * @since 29 Dec 2006
18   *
19   */
20  public class NonSQLPoemType implements PoemType<Object> {
21  
22      /**
23       * {@inheritDoc}
24       * @see org.melati.poem.PoemType#assertValidCooked(java.lang.Object)
25       */
26      public void assertValidCooked(Object cooked) throws TypeMismatchPoemException, ValidationPoemException {
27        assertValidRaw(cooked);
28        
29      }
30  
31      /**
32       * {@inheritDoc}
33       * @see org.melati.poem.PoemType#assertValidRaw(java.lang.Object)
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       * {@inheritDoc}
49       * @see org.melati.poem.PoemType#cookedOfRaw(java.lang.Object)
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       * {@inheritDoc}
60       * @see org.melati.poem.PoemType#getNullable()
61       */
62      public boolean getNullable() {
63        return false;
64      }
65  
66      /**
67       * {@inheritDoc}
68       * @see org.melati.poem.PoemType#possibleRaws()
69       */
70      public Enumeration<Object> possibleRaws() {
71        return null;
72      }
73  
74      /**
75       * {@inheritDoc}
76       * @see org.melati.poem.PoemType#rawOfCooked(java.lang.Object)
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       * {@inheritDoc}
87       * @see org.melati.poem.PoemType#rawOfString(java.lang.String)
88       */
89      public Object rawOfString(String rawString) throws ParsingPoemException, ValidationPoemException {
90        return null;
91      }
92  
93      /**
94       * {@inheritDoc}
95       * @see org.melati.poem.PoemType#saveColumnInfo(org.melati.poem.ColumnInfo)
96       */
97      public void saveColumnInfo(ColumnInfo columnInfo) throws AccessPoemException {
98      }
99  
100     /**
101      * {@inheritDoc}
102      * @see org.melati.poem.PoemType#stringOfCooked(java.lang.Object, org.melati.poem.PoemLocale, int)
103      */
104     public String stringOfCooked(Object cooked, PoemLocale locale, int style) 
105         throws TypeMismatchPoemException, PoemException {
106       return null;
107     }
108 
109     /**
110      * {@inheritDoc}
111      * @see org.melati.poem.PoemType#stringOfRaw(java.lang.Object)
112      */
113     public String stringOfRaw(Object raw) throws TypeMismatchPoemException, ValidationPoemException {
114       return null;
115     }
116 
117     /**
118      * {@inheritDoc}
119      * @see org.melati.poem.PoemType#toDsdType()
120      */
121     public String toDsdType() {
122       return null;
123     }
124 
125     /**
126      * {@inheritDoc}
127      * @see org.melati.poem.PoemType#withNullable(boolean)
128      */
129     public PoemType<Object> withNullable(boolean nullable) {
130       return null;
131     }
132     
133   }