1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
39 import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
40 import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
41 import javax.xml.bind.annotation.adapters.XmlAdapter;
42 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
43 import javax.xml.datatype.Duration;
44 import javax.xml.datatype.XMLGregorianCalendar;
45 import javax.xml.namespace.QName;
46 import javax.xml.transform.Source;
47
48 import com.sun.codemodel.internal.JExpr;
49 import com.sun.codemodel.internal.JExpression;
50 import com.sun.codemodel.internal.JType;
51 import com.sun.tools.internal.xjc.model.nav.NClass;
52 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
53 import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo;
54 import com.sun.xml.internal.bind.v2.model.core.Element;
55 import com.sun.xml.internal.bind.v2.model.core.LeafInfo;
56 import com.sun.xml.internal.bind.v2.runtime.Location;
57 import com.sun.tools.internal.xjc.model.nav.NType;
58 import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
59 import com.sun.tools.internal.xjc.outline.Aspect;
60 import com.sun.tools.internal.xjc.outline.Outline;
61 import com.sun.tools.internal.xjc.runtime.ZeroOneBooleanAdapter;
62 import com.sun.tools.internal.xjc.util.NamespaceContextAdapter;
63 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
64 import com.sun.xml.internal.bind.v2.model.core.ID;
65 import com.sun.xml.internal.xsom.XSComponent;
66 import com.sun.xml.internal.xsom.XmlString;
67
68 import org.xml.sax.Locator;
69
70 /**
71 * Encapsulates the default handling for leaf classes (which are bound
72 * to text in XML.) In particular this class knows how to convert
73 * the lexical value into the Java class according to this default rule.
74 *
75 * <p>
76 * This represents the spec-defined default handling for the Java
77 * type ({@link #getType()}.
78 *
79 * <p>
|
1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
39 import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
40 import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
41 import javax.xml.bind.annotation.adapters.XmlAdapter;
42 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
43 import javax.xml.datatype.Duration;
44 import javax.xml.datatype.XMLGregorianCalendar;
45 import javax.xml.namespace.QName;
46 import javax.xml.transform.Source;
47
48 import com.sun.codemodel.internal.JExpr;
49 import com.sun.codemodel.internal.JExpression;
50 import com.sun.codemodel.internal.JType;
51 import com.sun.tools.internal.xjc.model.nav.NClass;
52 import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
53 import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo;
54 import com.sun.xml.internal.bind.v2.model.core.Element;
55 import com.sun.xml.internal.bind.v2.model.core.LeafInfo;
56 import com.sun.xml.internal.bind.v2.runtime.Location;
57 import com.sun.tools.internal.xjc.model.nav.NType;
58 import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
59 import com.sun.tools.internal.xjc.outline.Outline;
60 import com.sun.tools.internal.xjc.runtime.ZeroOneBooleanAdapter;
61 import com.sun.tools.internal.xjc.util.NamespaceContextAdapter;
62 import com.sun.xml.internal.bind.v2.WellKnownNamespace;
63 import com.sun.xml.internal.bind.v2.model.core.ID;
64 import com.sun.xml.internal.xsom.XSComponent;
65 import com.sun.xml.internal.xsom.XmlString;
66
67 import org.xml.sax.Locator;
68
69 /**
70 * Encapsulates the default handling for leaf classes (which are bound
71 * to text in XML.) In particular this class knows how to convert
72 * the lexical value into the Java class according to this default rule.
73 *
74 * <p>
75 * This represents the spec-defined default handling for the Java
76 * type ({@link #getType()}.
77 *
78 * <p>
|