com.wewebu.ow.server.ecmimpl.cmis.util
Class OwCMISBooleanTextFormat

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

public class OwCMISBooleanTextFormat
extends Format

OwCMISBooleanTextFormat.

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

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
Format.Field
 
Constructor Summary
OwCMISBooleanTextFormat()
          Creates a BooleanFormat with default true/false formatting.
OwCMISBooleanTextFormat(String pattern_p)
          Constructs a boolean format from a pattern.
OwCMISBooleanTextFormat(String trueString_p, String falseString_p)
          Creates a BooleanFormat.
 
Method Summary
 StringBuffer format(Object obj_p, StringBuffer appendTo_p, FieldPosition pos_p)
          Formats a Boolean and appends the result to a StringBuffer.
 Boolean parse(String text_p)
          Parses text from the beginning of the given string to produce a boolean.
 Boolean parseObject(String source_p, ParsePosition pos_p)
          Parses a string into a Boolean.
 
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
 

Constructor Detail

OwCMISBooleanTextFormat

public OwCMISBooleanTextFormat()
Creates a BooleanFormat with default true/false formatting.


OwCMISBooleanTextFormat

public OwCMISBooleanTextFormat(String trueString_p,
                               String falseString_p)
                        throws com.wewebu.ow.server.exceptions.OwInvalidOperationException
Creates a BooleanFormat.

Parameters:
trueString_p - A string representing true.
falseString_p - A string representing false.
Throws:
com.wewebu.ow.server.exceptions.OwInvalidOperationException

OwCMISBooleanTextFormat

public OwCMISBooleanTextFormat(String pattern_p)
                        throws com.wewebu.ow.server.exceptions.OwInvalidOperationException
Constructs a boolean format from a pattern. The pattern must contain two strings separated by colon, for example: "true:false".

Parameters:
pattern_p - The pattern from which to construct.
Throws:
com.wewebu.ow.server.exceptions.OwInvalidOperationException
Method Detail

format

public StringBuffer format(Object obj_p,
                           StringBuffer appendTo_p,
                           FieldPosition pos_p)
Formats a Boolean and appends the result to a StringBuffer.

Specified by:
format in class Format
Parameters:
obj_p - The object to format.
appendTo_p - The StringBuffer to which the formatted string will be appended.
pos_p - A FieldPosition param (not used in this class).
Returns:
A StringBuffer with the formatted string for this object.

parseObject

public Boolean parseObject(String source_p,
                           ParsePosition pos_p)
Parses a string into a Boolean. A string can be either a trueString or a falseString (non-case sensitive).

Specified by:
parseObject in class Format
Parameters:
source_p - The string from which to parse.
pos_p - Marks the end of the parsing, or 0 if the parsing failed.
Returns:
A Boolean for the parsed string.

parse

public Boolean parse(String text_p)
              throws ParseException
Parses text from the beginning of the given string to produce a boolean. The method may not use the entire text of the given string.

Parameters:
text_p - A String that should be parsed from it's start.
Returns:
A Boolean parsed from the string.
Throws:
ParseException - If the string cannot be parsed.


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.