KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > js > impl > TypedValueImpl


1 package org.apache.ws.jaxme.js.impl;
2
3 import java.io.IOException JavaDoc;
4
5 import org.apache.ws.jaxme.js.IndentationEngine;
6 import org.apache.ws.jaxme.js.IndentationTarget;
7 import org.apache.ws.jaxme.js.IndentedObject;
8 import org.apache.ws.jaxme.js.JavaQName;
9 import org.apache.ws.jaxme.js.JavaQNameImpl;
10 import org.apache.ws.jaxme.js.TypedValue;
11
12
13 /** Default implementation of a typed value.
14  */

15 public class TypedValueImpl implements TypedValue, IndentedObject {
16     private final Object JavaDoc value;
17     private final JavaQName type;
18
19     /** Creates a new instance with the given value and
20      * the given type.
21      */

22     public TypedValueImpl(Object JavaDoc pValue, JavaQName pType) {
23         value = pValue;
24         type = pType;
25     }
26     /** Creates a new instance with the given value and
27      * the given type.
28      */

29     public TypedValueImpl(Object JavaDoc pValue, Class JavaDoc pType) {
30         this(pValue, JavaQNameImpl.getInstance(pType));
31     }
32     public JavaQName getType() { return type; }
33     public void write(IndentationEngine pEngine, IndentationTarget pTarget) throws IOException JavaDoc {
34         pEngine.write(pTarget, value);
35     }
36 }
37
Popular Tags