com.davisor.data
Class URLTextOutputType

java.lang.Object
  extended byjava.text.Format
      extended bycom.davisor.data.Type
          extended bycom.davisor.data.TextType
              extended bycom.davisor.data.URLTextType
                  extended bycom.davisor.data.URLTextOutputType
All Implemented Interfaces:
java.lang.Cloneable, java.util.Comparator, com.davisor.core.Dupable, java.io.Serializable

public class URLTextOutputType
extends URLTextType

URLTextOuputType defines a data type that writes text strings as URL-encoded, but always parses them as plain text.

Since:
JDK1.1
See Also:
TextData, URLTextType, Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
static java.lang.String TYPENAME
          Type name ("OURLText").
 
Fields inherited from class com.davisor.data.URLTextType
DEFAULT
 
Fields inherited from class com.davisor.data.Type
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS
 
Constructor Summary
  URLTextOutputType()
          Default constructor.
  URLTextOutputType(java.lang.String dataName)
          Creates a new default type with no identity.
  URLTextOutputType(java.lang.String dataName, java.lang.String id, java.util.Map metaData, int maxLength, java.lang.String prefix)
          Creates a new URL output text type.
  URLTextOutputType(java.lang.String dataName, java.lang.String id, java.lang.String format)
          Constructs a new type.
protected URLTextOutputType(java.lang.String typeName, java.lang.String dataName, java.lang.String id, java.util.Map metaData, int maxLength, java.lang.String prefix)
          Creates a new URL output text type.
  URLTextOutputType(URLTextOutputType utot)
          Copy constructor.
 
Method Summary
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
 java.lang.String stringValue(java.lang.String value)
          URL-encodes a text string.
 
Methods inherited from class com.davisor.data.URLTextType
check, getCompatibility, getFormat, getValueClass, setFormat, toData
 
Methods inherited from class com.davisor.data.TextType
equals, getMaxLength, getPrefix, getSQLCode, hashCode, setMaxLength, setPrefix, stringValue, zero
 
Methods inherited from class com.davisor.data.Type
ceil, check, compare, create, create, create, create, create, dup, floor, format, getDataName, getId, getID, getMetaData, getMetaData, getSpecs, getSQLName, getSQLName, getTypeName, isNull, parseObject, register, register, setDataName, setId, setID, setMetaData, setMetaData, setSpecs, toData, toData, toData, toString, toXML, xmlEnd, xmlStart
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPENAME

public static final java.lang.String TYPENAME
Type name ("OURLText").

See Also:
Constant Field Values
Constructor Detail

URLTextOutputType

public URLTextOutputType()
Default constructor.


URLTextOutputType

public URLTextOutputType(URLTextOutputType utot)
Copy constructor.


URLTextOutputType

public URLTextOutputType(java.lang.String dataName)
Creates a new default type with no identity.

Parameters:
dataName - data name (may be null)

URLTextOutputType

public URLTextOutputType(java.lang.String dataName,
                         java.lang.String id,
                         java.lang.String format)
Constructs a new type.

This is the constructor the SQL type mapper Type.create(Integer,String,String,String) method will call to create a type that matches given SQL type.

Parameters:
dataName - data name (may be null)
id - type identity (may be null)
format - type spesification (may be null)
See Also:
URLTextType.setFormat(java.lang.String)

URLTextOutputType

public URLTextOutputType(java.lang.String dataName,
                         java.lang.String id,
                         java.util.Map metaData,
                         int maxLength,
                         java.lang.String prefix)
Creates a new URL output text type.

Parameters:
dataName - type name (may be null)
id - type identity (may be null)
metaData - type meta data map (may be null)
maxLength - maximum text length
prefix - mandatory text prefix (may be null)

URLTextOutputType

protected URLTextOutputType(java.lang.String typeName,
                            java.lang.String dataName,
                            java.lang.String id,
                            java.util.Map metaData,
                            int maxLength,
                            java.lang.String prefix)
Creates a new URL output text type.

Parameters:
typeName - type name
dataName - type name (may be null)
id - type identity (may be null)
metaData - type meta data map (may be null)
maxLength - maximum text length
prefix - mandatory text prefix (may be null)
Method Detail

dup

public com.davisor.core.Dupable dup()
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
Overrides:
dup in class URLTextType

stringValue

public java.lang.String stringValue(java.lang.String value)
                             throws InvalidDataException
URL-encodes a text string.

Overrides:
stringValue in class URLTextType
Parameters:
value - data string value
Returns:
URL-encoded data string
Throws:
InvalidDataException - never
See Also:
URLEncoder.encode(String), URLTextType.stringValue(java.lang.String)


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.