com.wewebu.ow.server.ecmimpl.cmis.propertyclasses
Class OwISOSimpleFormatAdapter

java.lang.Object
  extended by java.text.Format
      extended by com.wewebu.ow.server.ecmimpl.cmis.propertyclasses.OwISOSimpleFormatAdapter
All Implemented Interfaces:
Serializable, Cloneable

public class OwISOSimpleFormatAdapter
extends Format

ISO 8601 compliant Format adapter for SimpleDateFormat. Addapts Z (Zulu time zone) to simple date formats 0 offset.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
4.0.0.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
Format.Field
 
Field Summary
protected static String PATTERN_FULL
           
 
Constructor Summary
OwISOSimpleFormatAdapter(SimpleDateFormat zoneFormat_p, SimpleDateFormat noZoneFormat_p)
           
 
Method Summary
 StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
           
 Object parseObject(String source, ParsePosition pos)
           
protected  Object parseObjectByIdentification(String source, ParsePosition pos)
          Process if default parse does not work like requested.
protected  TimeZone parseTimeZone(String zone)
          Create specific zone
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATTERN_FULL

protected static final String PATTERN_FULL
See Also:
Constant Field Values
Constructor Detail

OwISOSimpleFormatAdapter

public OwISOSimpleFormatAdapter(SimpleDateFormat zoneFormat_p,
                                SimpleDateFormat noZoneFormat_p)
Method Detail

format

public final StringBuffer format(Object obj,
                                 StringBuffer toAppendTo,
                                 FieldPosition pos)
Specified by:
format in class Format

parseObject

public final Object parseObject(String source,
                                ParsePosition pos)
Specified by:
parseObject in class Format

parseObjectByIdentification

protected Object parseObjectByIdentification(String source,
                                             ParsePosition pos)
Process if default parse does not work like requested.

By default use the PATTERN_FULL format without TimeZone, handling time zone with additional logic.

Parameters:
source - String representing ISO date
pos - ParsePostion used by java.text.Format
Returns:
Object (Date) or null if could not parse

parseTimeZone

protected TimeZone parseTimeZone(String zone)
Create specific zone

Parameters:
zone - String extracted time zone
Returns:
TimeZone


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.