org.apache.jdo.impl.model.java
Class NullType

java.lang.Object
  extended by org.apache.jdo.impl.model.java.AbstractJavaType
      extended by org.apache.jdo.impl.model.java.NullType
All Implemented Interfaces:
JavaElement, JavaType

public class NullType
extends AbstractJavaType

An instance of class NullType represents the type of the null expression in Java. It is compatible to all reference types.

Since:
JDO 1.0.1
Author:
Michael Bouschen

Field Summary
static NullType nullType
          The singleton NullType instance.
 
Constructor Summary
protected NullType()
          Creates new a NullType instance.
 
Method Summary
 java.lang.String getName()
          Returns the name of the type.
 boolean isCompatibleWith(JavaType javaType)
          Returns true if this JavaType is compatible with the specified JavaType.
 
Methods inherited from class org.apache.jdo.impl.model.java.AbstractJavaType
equals, getArrayComponentType, getDeclaredJavaFields, getDeclaredJavaProperties, getJavaField, getJavaProperty, getJDOClass, getModifiers, getSuperclass, getUnderlyingObject, hashCode, isArray, isFloatingPoint, isIntegral, isInterface, isJDOSupportedCollection, isJDOSupportedMap, isOrderable, isPersistenceCapable, isPrimitive, isTrackable, isValue, isWrapperClass, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

nullType

public static final NullType nullType
The singleton NullType instance.

Constructor Detail

NullType

protected NullType()
Creates new a NullType instance. This constructor should not be called directly; instead, the singleton instance nullType should be used.

Method Detail

isCompatibleWith

public boolean isCompatibleWith(JavaType javaType)
Returns true if this JavaType is compatible with the specified JavaType. This implementation returns true, if the specified javaType is a not a primitive type, because the type of null is compatiple with all reference types.

Specified by:
isCompatibleWith in interface JavaType
Overrides:
isCompatibleWith in class AbstractJavaType
Parameters:
javaType - the type this JavaType is checked with.
Returns:
true if this is compatible with the specified type; false otherwise.

getName

public java.lang.String getName()
Returns the name of the type.

Specified by:
getName in interface JavaType
Specified by:
getName in class AbstractJavaType
Returns:
type name


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.