org.datanucleus.store.mapped.mapping
Class URLMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.SingleFieldMapping
          extended by org.datanucleus.store.mapped.mapping.ObjectAsStringMapping
              extended by org.datanucleus.store.mapped.mapping.URLMapping

public class URLMapping
extends ObjectAsStringMapping

Mapping for java.net.URL type.


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
URLMapping()
           
 
Method Summary
 java.lang.Class getJavaType()
          Method to return the Java type.
 java.lang.Object getSampleValue(ClassLoaderResolver clr)
          Return a sample value of the mapping type to be used for internal evaluation of type/conversion.
protected  java.lang.String objectToString(java.lang.Object object)
          Method to set the datastore string value based on the object value.
protected  java.lang.Object stringToObject(java.lang.String datastoreValue)
          Method to extract the objects value from the datastore string value.
 
Methods inherited from class org.datanucleus.store.mapped.mapping.ObjectAsStringMapping
getJavaTypeForDatastoreMapping, getObject, newLiteral, newScalarExpression, setObject
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMapping
equals, getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getLong, getShort, getString, getValidValues, initialize, prepareDatastoreMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
 
Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setDatastoreContainer, setDefault, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLMapping

public URLMapping()
Method Detail

getJavaType

public java.lang.Class getJavaType()
Method to return the Java type. In our case a java.net.URL.

Specified by:
getJavaType in class ObjectAsStringMapping
Returns:
The Java type being represented.
See Also:
JavaTypeMapping.getJavaType()

objectToString

protected java.lang.String objectToString(java.lang.Object object)
Method to set the datastore string value based on the object value.

Specified by:
objectToString in class ObjectAsStringMapping
Parameters:
object - The object
Returns:
The string value to pass to the datastore

stringToObject

protected java.lang.Object stringToObject(java.lang.String datastoreValue)
Method to extract the objects value from the datastore string value.

Specified by:
stringToObject in class ObjectAsStringMapping
Parameters:
datastoreValue - Value obtained from the datastore
Returns:
The value of this object (derived from the datastore string value)

getSampleValue

public java.lang.Object getSampleValue(ClassLoaderResolver clr)
Description copied from class: JavaTypeMapping
Return a sample value of the mapping type to be used for internal evaluation of type/conversion. TODO Delete when we drop legacy support

Overrides:
getSampleValue in class JavaTypeMapping
Parameters:
clr - ClassLoader resolver
Returns:
The sample value.


Copyright © 2010. All Rights Reserved.