KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > datatypes > xsd > impl > XSDGenericType


1 /******************************************************************
2  * File: XSDGenericType.java
3  * Created by: Dave Reynolds
4  * Created on: 13-Dec-2002
5  *
6  * (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: XSDGenericType.java,v 1.8 2005/02/21 12:02:24 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.datatypes.xsd.impl;
11
12 import org.apache.xerces.impl.dv.XSSimpleType;
13
14 import com.hp.hpl.jena.datatypes.xsd.*;
15
16 /**
17  * Datatype template that adapts any response back from Xerces type parsing
18  * to an appropriate java representation. This is primarily used in creating
19  * user defined types - the built in types have a fixed mapping.
20  * <p>
21  * This class is probably now redundant in that XSDDatatype can support
22  * run time conversion of union results. Left in for now during restructuring and
23  * in case any existing user code expects this type - very unlikely.
24  * </p>
25  *
26  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
27  * @version $Revision: 1.8 $ on $Date: 2005/02/21 12:02:24 $
28  */

29 public class XSDGenericType extends XSDDatatype {
30
31     /**
32      * Hidden constructor used when loading in external user defined XSD types
33      * @param xstype the XSSimpleType definition to be wrapped
34      * @param namespace the namespace for the type (used because the grammar loading doesn't seem to keep that)
35      */

36     public XSDGenericType(XSSimpleType xstype, String JavaDoc namespace) {
37         super(xstype, namespace);
38     }
39
40
41 // No longer need to perform any special case processing of union types since we
42
// now do runtime type coercion - is that right?
43

44 // /**
45
// * Parse a lexical form of this datatype to a value
46
// * @throws DatatypeFormatException if the lexical form is not legal
47
// */
48
// public Object parse(String lexicalForm) throws DatatypeFormatException {
49
// try {
50
// ValidationContext context = new ValidationState();
51
// ValidatedInfo resultInfo = new ValidatedInfo();
52
// Object result = typeDeclaration.validate(lexicalForm, context, resultInfo);
53
// return convertValidatedDataValue(resultInfo);
54
// } catch (InvalidDatatypeValueException e) {
55
// throw new DatatypeFormatException(lexicalForm, this, "during parse -" + e);
56
// }
57
// }
58

59  
60 }
61
62 /*
63     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
64     All rights reserved.
65
66     Redistribution and use in source and binary forms, with or without
67     modification, are permitted provided that the following conditions
68     are met:
69
70     1. Redistributions of source code must retain the above copyright
71        notice, this list of conditions and the following disclaimer.
72
73     2. Redistributions in binary form must reproduce the above copyright
74        notice, this list of conditions and the following disclaimer in the
75        documentation and/or other materials provided with the distribution.
76
77     3. The name of the author may not be used to endorse or promote products
78        derived from this software without specific prior written permission.
79
80     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
81     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
82     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
83     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
84     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
85     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
86     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
87     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
88     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
89     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90 */

91
Popular Tags