KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > parsing > TypeHelper


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.parsing;
23
24 /**
25  * INTERNAL
26  * <p><b>Purpose</b>: Specify type helper methods.
27  */

28 public interface TypeHelper {
29
30     /** Returns the name of the specified type. */
31     public String JavaDoc getTypeName(Object JavaDoc type);
32
33     /** Returns a type representation for the specified type name or null if
34      * there is no such type. */

35     public Object JavaDoc resolveTypeName(String JavaDoc typeName);
36
37     /** Returns the type of the attribute with the specified name in the
38      * specified owner class. */

39     public Object JavaDoc resolveAttribute(Object JavaDoc ownerClass, String JavaDoc attribute);
40
41     /** Returns the type of the class corresponding to the spcified abstract
42      * schema type. */

43     public Object JavaDoc resolveSchema(String JavaDoc schemaName);
44
45     /** Returns the enum constant if the specified type denotes an enum type
46      * and the specified constant denotes a constant of the enum type. */

47     public Object JavaDoc resolveEnumConstant(Object JavaDoc enumType, String JavaDoc constant);
48
49     /** Returns the type representation of class Object.*/
50     public Object JavaDoc getObjectType();
51
52     /** Returns the boolean type representation.*/
53     public Object JavaDoc getBooleanType();
54
55     /** Returns the char type representation.*/
56     public Object JavaDoc getCharType();
57
58     /** Returns the int type representation.*/
59     public Object JavaDoc getIntType();
60
61     /** Returns the long type representation.*/
62     public Object JavaDoc getLongType();
63
64     /** Returns the type representation of class Long.*/
65     public Object JavaDoc getLongClassType();
66
67     /** Returns the float type representation.*/
68     public Object JavaDoc getFloatType();
69
70     /** Returns the double type representation.*/
71     public Object JavaDoc getDoubleType();
72
73     /** Returns the type representation of class Double.*/
74     public Object JavaDoc getDoubleClassType();
75
76     /** Returns the type representation oc class String.*/
77     public Object JavaDoc getStringType();
78
79     /** Returns the type representation of class BigInteger.*/
80     public Object JavaDoc getBigIntegerType();
81
82     /** Returns the type representation of class BigDecimal.*/
83     public Object JavaDoc getBigDecimalType();
84
85     /** Returns true if the specified type denotes an enum type. */
86     public boolean isEnumType(Object JavaDoc type);
87
88     /** Returns true if the specified type represents an
89      * integral type (or wrapper), a floating point type (or wrapper),
90      * BigInteger or BigDecimal. */

91     public boolean isNumericType(Object JavaDoc type);
92
93     /** Returns true if the specified type represents an
94      * integral type or a wrapper class of an integral type. */

95     public boolean isIntegralType(Object JavaDoc type);
96     
97     /** Returns true if the specified type represents an floating point type
98      * or a wrapper class of an floating point type. */

99     public boolean isFloatingPointType(Object JavaDoc type);
100
101     /** Returns true if the specified type represents java.lang.String. */
102     public boolean isStringType(Object JavaDoc type);
103
104     /** Returns true if the specified type represents java.math.BigInteger. */
105     public boolean isBigIntegerType(Object JavaDoc type);
106
107     /** Returns true if the specified type represents java.math.BigDecimal. */
108     public boolean isBigDecimalType(Object JavaDoc type);
109
110     /** Returns true if the specified type denotes an orable type. */
111     public boolean isOrderableType(Object JavaDoc type);
112
113     /** Returns true if the specified type denotes an entity class. */
114     public boolean isEntityClass(Object JavaDoc type);
115
116     /** Returns true if the specified type denotes an embedded class. */
117     public boolean isEmbeddable(Object JavaDoc type);
118     
119     /** Returns true if the specified type denotes an embedded attribute. */
120     public boolean isEmbeddedAttribute(Object JavaDoc ownerClass, String JavaDoc attribute);
121
122     /** Returns true if left is assignable from right. */
123     public boolean isAssignableFrom(Object JavaDoc left, Object JavaDoc right);
124
125     /** Binary numeric promotion as specified in the JLS, extended by
126      * wrapper classes, BigDecimal and BigInteger. */

127     public Object JavaDoc extendedBinaryNumericPromotion(Object JavaDoc left, Object JavaDoc right);
128 }
129
Popular Tags