Java Doc for DateTimeFormatterBuilder.java in  » Development » Joda-Time » org » joda » time » format » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Joda Time » org.joda.time.format 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.joda.time.format.DateTimeFormatterBuilder

DateTimeFormatterBuilder
public class DateTimeFormatterBuilder (Code)
Factory that creates complex instances of DateTimeFormatter via method calls.

Datetime formatting is performed by the DateTimeFormatter class. Three classes provide factory methods to create formatters, and this is one. The others are DateTimeFormat and ISODateTimeFormat .

DateTimeFormatterBuilder is used for constructing formatters which are then used to print or parse. The formatters are built by appending specific fields or other formatters to an instance of this builder.

For example, a formatter that prints month and year, like "January 1970", can be constructed as follows:

 DateTimeFormatter monthAndYear = new DateTimeFormatterBuilder()
 .appendMonthOfYearText()
 .appendLiteral(' ')
 .appendYear(4, 4)
 .toFormatter();
 

DateTimeFormatterBuilder itself is mutable and not thread-safe, but the formatters that it builds are thread-safe and immutable.
author:
   Brian S O'Neill
author:
   Stephen Colebourne
author:
   Fredrik Borgh
since:
   1.0
See Also:   DateTimeFormat
See Also:   ISODateTimeFormat


Inner Class :static class CharacterLiteral implements DateTimePrinter,DateTimeParser
Inner Class :static class StringLiteral implements DateTimePrinter,DateTimeParser
Inner Class :abstract static class NumberFormatter implements DateTimePrinter,DateTimeParser
Inner Class :static class UnpaddedNumber extends NumberFormatter
Inner Class :static class PaddedNumber extends NumberFormatter
Inner Class :static class FixedNumber extends PaddedNumber
Inner Class :static class TwoDigitYear implements DateTimePrinter,DateTimeParser
Inner Class :static class TextField implements DateTimePrinter,DateTimeParser
Inner Class :static class Fraction implements DateTimePrinter,DateTimeParser
Inner Class :static class TimeZoneOffset implements DateTimePrinter,DateTimeParser
Inner Class :static class TimeZoneName implements DateTimePrinter
Inner Class :static class Composite implements DateTimePrinter,DateTimeParser
Inner Class :static class MatchingParser implements DateTimeParser


Constructor Summary
public  DateTimeFormatterBuilder()
     Creates a DateTimeFormatterBuilder.

Method Summary
public  DateTimeFormatterBuilderappend(DateTimeFormatter formatter)
     Appends another formatter.
public  DateTimeFormatterBuilderappend(DateTimePrinter printer)
     Appends just a printer.
public  DateTimeFormatterBuilderappend(DateTimeParser parser)
     Appends just a parser.
public  DateTimeFormatterBuilderappend(DateTimePrinter printer, DateTimeParser parser)
     Appends a printer/parser pair.
public  DateTimeFormatterBuilderappend(DateTimePrinter printer, DateTimeParser[] parsers)
     Appends a printer and a set of matching parsers.
public  DateTimeFormatterBuilderappendCenturyOfEra(int minDigits, int maxDigits)
     Instructs the printer to emit a numeric century of era field.
public  DateTimeFormatterBuilderappendClockhourOfDay(int minDigits)
     Instructs the printer to emit a numeric clockhourOfDay field.
public  DateTimeFormatterBuilderappendClockhourOfHalfday(int minDigits)
     Instructs the printer to emit a numeric clockhourOfHalfday field.
public  DateTimeFormatterBuilderappendDayOfMonth(int minDigits)
     Instructs the printer to emit a numeric dayOfMonth field.
public  DateTimeFormatterBuilderappendDayOfWeek(int minDigits)
     Instructs the printer to emit a numeric dayOfWeek field.
public  DateTimeFormatterBuilderappendDayOfWeekShortText()
     Instructs the printer to emit a short locale-specific dayOfWeek text.
public  DateTimeFormatterBuilderappendDayOfWeekText()
     Instructs the printer to emit a locale-specific dayOfWeek text.
public  DateTimeFormatterBuilderappendDayOfYear(int minDigits)
     Instructs the printer to emit a numeric dayOfYear field.
public  DateTimeFormatterBuilderappendDecimal(DateTimeFieldType fieldType, int minDigits, int maxDigits)
     Instructs the printer to emit a field value as a decimal number, and the parser to expect an unsigned decimal number.
public  DateTimeFormatterBuilderappendEraText()
     Instructs the printer to emit a locale-specific era text (BC/AD), and the parser to expect it.
public  DateTimeFormatterBuilderappendFixedDecimal(DateTimeFieldType fieldType, int numDigits)
     Instructs the printer to emit a field value as a fixed-width decimal number (smaller numbers will be left-padded with zeros), and the parser to expect an unsigned decimal number with the same fixed width.
public  DateTimeFormatterBuilderappendFixedSignedDecimal(DateTimeFieldType fieldType, int numDigits)
     Instructs the printer to emit a field value as a fixed-width decimal number (smaller numbers will be left-padded with zeros), and the parser to expect an signed decimal number with the same fixed width.
public  DateTimeFormatterBuilderappendFraction(DateTimeFieldType fieldType, int minDigits, int maxDigits)
     Instructs the printer to emit a remainder of time as a decimal fraction, sans decimal point.
public  DateTimeFormatterBuilderappendFractionOfDay(int minDigits, int maxDigits)
    
public  DateTimeFormatterBuilderappendFractionOfHour(int minDigits, int maxDigits)
    
public  DateTimeFormatterBuilderappendFractionOfMinute(int minDigits, int maxDigits)
    
public  DateTimeFormatterBuilderappendFractionOfSecond(int minDigits, int maxDigits)
    
public  DateTimeFormatterBuilderappendHalfdayOfDayText()
     Instructs the printer to emit a locale-specific AM/PM text, and the parser to expect it.
public  DateTimeFormatterBuilderappendHourOfDay(int minDigits)
     Instructs the printer to emit a numeric hourOfDay field.
public  DateTimeFormatterBuilderappendHourOfHalfday(int minDigits)
     Instructs the printer to emit a numeric hourOfHalfday field.
public  DateTimeFormatterBuilderappendLiteral(char c)
     Instructs the printer to emit a specific character, and the parser to expect it.
public  DateTimeFormatterBuilderappendLiteral(String text)
     Instructs the printer to emit specific text, and the parser to expect it.
public  DateTimeFormatterBuilderappendMillisOfDay(int minDigits)
     Instructs the printer to emit a numeric millisOfDay field.
public  DateTimeFormatterBuilderappendMillisOfSecond(int minDigits)
     Instructs the printer to emit a numeric millisOfSecond field.
public  DateTimeFormatterBuilderappendMinuteOfDay(int minDigits)
     Instructs the printer to emit a numeric minuteOfDay field.
public  DateTimeFormatterBuilderappendMinuteOfHour(int minDigits)
     Instructs the printer to emit a numeric minuteOfHour field.
public  DateTimeFormatterBuilderappendMonthOfYear(int minDigits)
     Instructs the printer to emit a numeric monthOfYear field.
public  DateTimeFormatterBuilderappendMonthOfYearShortText()
     Instructs the printer to emit a locale-specific monthOfYear text.
public  DateTimeFormatterBuilderappendMonthOfYearText()
     Instructs the printer to emit a short locale-specific monthOfYear text.
public  DateTimeFormatterBuilderappendOptional(DateTimeParser parser)
     Appends just a parser element which is optional.
public  DateTimeFormatterBuilderappendPattern(String pattern)
     Calls upon DateTimeFormat to parse the pattern and append the results into this builder.
public  DateTimeFormatterBuilderappendSecondOfDay(int minDigits)
     Instructs the printer to emit a numeric secondOfDay field.
public  DateTimeFormatterBuilderappendSecondOfMinute(int minDigits)
     Instructs the printer to emit a numeric secondOfMinute field.
public  DateTimeFormatterBuilderappendShortText(DateTimeFieldType fieldType)
     Instructs the printer to emit a field value as short text, and the parser to expect text.
public  DateTimeFormatterBuilderappendSignedDecimal(DateTimeFieldType fieldType, int minDigits, int maxDigits)
     Instructs the printer to emit a field value as a decimal number, and the parser to expect a signed decimal number.
public  DateTimeFormatterBuilderappendText(DateTimeFieldType fieldType)
     Instructs the printer to emit a field value as text, and the parser to expect text.
public  DateTimeFormatterBuilderappendTimeZoneId()
     Instructs the printer to emit the identifier of the time zone.
public  DateTimeFormatterBuilderappendTimeZoneName()
     Instructs the printer to emit a locale-specific time zone name.
public  DateTimeFormatterBuilderappendTimeZoneOffset(String zeroOffsetText, boolean showSeparators, int minFields, int maxFields)
     Instructs the printer to emit text and numbers to display time zone offset from UTC.
public  DateTimeFormatterBuilderappendTimeZoneShortName()
     Instructs the printer to emit a short locale-specific time zone name.
public  DateTimeFormatterBuilderappendTwoDigitWeekyear(int pivot)
     Instructs the printer to emit a numeric weekyear field which always prints and parses two digits.
public  DateTimeFormatterBuilderappendTwoDigitWeekyear(int pivot, boolean lenientParse)
     Instructs the printer to emit a numeric weekyear field which always prints two digits.
public  DateTimeFormatterBuilderappendTwoDigitYear(int pivot)
     Instructs the printer to emit a numeric year field which always prints and parses two digits.
public  DateTimeFormatterBuilderappendTwoDigitYear(int pivot, boolean lenientParse)
     Instructs the printer to emit a numeric year field which always prints two digits.
static  voidappendUnknownString(StringBuffer buf, int len)
    
public  DateTimeFormatterBuilderappendWeekOfWeekyear(int minDigits)
     Instructs the printer to emit a numeric weekOfWeekyear field.
public  DateTimeFormatterBuilderappendWeekyear(int minDigits, int maxDigits)
     Instructs the printer to emit a numeric weekyear field.
public  DateTimeFormatterBuilderappendYear(int minDigits, int maxDigits)
     Instructs the printer to emit a numeric year field.
public  DateTimeFormatterBuilderappendYearOfCentury(int minDigits, int maxDigits)
     Instructs the printer to emit a numeric year of century field.
public  DateTimeFormatterBuilderappendYearOfEra(int minDigits, int maxDigits)
     Instructs the printer to emit a numeric yearOfEra field.
public  booleancanBuildFormatter()
     Returns true if toFormatter can be called without throwing an UnsupportedOperationException.
public  booleancanBuildParser()
     Returns true if toParser can be called without throwing an UnsupportedOperationException.
public  booleancanBuildPrinter()
     Returns true if toPrinter can be called without throwing an UnsupportedOperationException.
public  voidclear()
     Clears out all the appended elements, allowing this builder to be reused.
static  voidprintUnknownString(Writer out, int len)
    
public  DateTimeFormattertoFormatter()
     Constructs a DateTimeFormatter using all the appended elements.
public  DateTimeParsertoParser()
     Internal method to create a DateTimeParser instance using all the appended elements.
public  DateTimePrintertoPrinter()
     Internal method to create a DateTimePrinter instance using all the appended elements.


Constructor Detail
DateTimeFormatterBuilder
public DateTimeFormatterBuilder()(Code)
Creates a DateTimeFormatterBuilder.




Method Detail
append
public DateTimeFormatterBuilder append(DateTimeFormatter formatter)(Code)
Appends another formatter.
Parameters:
  formatter - the formatter to add this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if formatter is null or of an invalid type



append
public DateTimeFormatterBuilder append(DateTimePrinter printer)(Code)
Appends just a printer. With no matching parser, a parser cannot be built from this DateTimeFormatterBuilder.
Parameters:
  printer - the printer to add this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if printer is null or of an invalid type



append
public DateTimeFormatterBuilder append(DateTimeParser parser)(Code)
Appends just a parser. With no matching printer, a printer cannot be built from this builder.
Parameters:
  parser - the parser to add this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if parser is null or of an invalid type



append
public DateTimeFormatterBuilder append(DateTimePrinter printer, DateTimeParser parser)(Code)
Appends a printer/parser pair.
Parameters:
  printer - the printer to add
Parameters:
  parser - the parser to add this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if printer or parser is null or of an invalid type



append
public DateTimeFormatterBuilder append(DateTimePrinter printer, DateTimeParser[] parsers)(Code)
Appends a printer and a set of matching parsers. When parsing, the first parser in the list is selected for parsing. If it fails, the next is chosen, and so on. If none of these parsers succeeds, then the failed position of the parser that made the greatest progress is returned.

Only the printer is optional. In addtion, it is illegal for any but the last of the parser array elements to be null. If the last element is null, this represents the empty parser. The presence of an empty parser indicates that the entire array of parse formats is optional.
Parameters:
  printer - the printer to add
Parameters:
  parsers - the parsers to add this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if any printer or parser is of an invalid type
throws:
  IllegalArgumentException - if any parser element but the last is null




appendCenturyOfEra
public DateTimeFormatterBuilder appendCenturyOfEra(int minDigits, int maxDigits)(Code)
Instructs the printer to emit a numeric century of era field.
Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to parse, or the estimatedmaximum number of digits to print this DateTimeFormatterBuilder



appendClockhourOfDay
public DateTimeFormatterBuilder appendClockhourOfDay(int minDigits)(Code)
Instructs the printer to emit a numeric clockhourOfDay field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendClockhourOfHalfday
public DateTimeFormatterBuilder appendClockhourOfHalfday(int minDigits)(Code)
Instructs the printer to emit a numeric clockhourOfHalfday field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendDayOfMonth
public DateTimeFormatterBuilder appendDayOfMonth(int minDigits)(Code)
Instructs the printer to emit a numeric dayOfMonth field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendDayOfWeek
public DateTimeFormatterBuilder appendDayOfWeek(int minDigits)(Code)
Instructs the printer to emit a numeric dayOfWeek field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendDayOfWeekShortText
public DateTimeFormatterBuilder appendDayOfWeekShortText()(Code)
Instructs the printer to emit a short locale-specific dayOfWeek text. The parser will accept a long or short dayOfWeek text, case-insensitive. this DateTimeFormatterBuilder



appendDayOfWeekText
public DateTimeFormatterBuilder appendDayOfWeekText()(Code)
Instructs the printer to emit a locale-specific dayOfWeek text. The parser will accept a long or short dayOfWeek text, case-insensitive. this DateTimeFormatterBuilder



appendDayOfYear
public DateTimeFormatterBuilder appendDayOfYear(int minDigits)(Code)
Instructs the printer to emit a numeric dayOfYear field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendDecimal
public DateTimeFormatterBuilder appendDecimal(DateTimeFieldType fieldType, int minDigits, int maxDigits)(Code)
Instructs the printer to emit a field value as a decimal number, and the parser to expect an unsigned decimal number.
Parameters:
  fieldType - type of field to append
Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to parse, or the estimatedmaximum number of digits to print this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if field type is null



appendEraText
public DateTimeFormatterBuilder appendEraText()(Code)
Instructs the printer to emit a locale-specific era text (BC/AD), and the parser to expect it. The parser is case-insensitive. this DateTimeFormatterBuilder



appendFixedDecimal
public DateTimeFormatterBuilder appendFixedDecimal(DateTimeFieldType fieldType, int numDigits)(Code)
Instructs the printer to emit a field value as a fixed-width decimal number (smaller numbers will be left-padded with zeros), and the parser to expect an unsigned decimal number with the same fixed width.
Parameters:
  fieldType - type of field to append
Parameters:
  numDigits - the exact number of digits to parse or print, except ifprinted value requires more digits this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if field type is null or if numDigits <= 0
since:
   1.5



appendFixedSignedDecimal
public DateTimeFormatterBuilder appendFixedSignedDecimal(DateTimeFieldType fieldType, int numDigits)(Code)
Instructs the printer to emit a field value as a fixed-width decimal number (smaller numbers will be left-padded with zeros), and the parser to expect an signed decimal number with the same fixed width.
Parameters:
  fieldType - type of field to append
Parameters:
  numDigits - the exact number of digits to parse or print, except ifprinted value requires more digits this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if field type is null or if numDigits <= 0
since:
   1.5



appendFraction
public DateTimeFormatterBuilder appendFraction(DateTimeFieldType fieldType, int minDigits, int maxDigits)(Code)
Instructs the printer to emit a remainder of time as a decimal fraction, sans decimal point. For example, if the field is specified as minuteOfHour and the time is 12:30:45, the value printed is 75. A decimal point is implied, so the fraction is 0.75, or three-quarters of a minute.
Parameters:
  fieldType - type of field to append
Parameters:
  minDigits - minumum number of digits to print.
Parameters:
  maxDigits - maximum number of digits to print or parse. this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if field type is null



appendFractionOfDay
public DateTimeFormatterBuilder appendFractionOfDay(int minDigits, int maxDigits)(Code)

Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to print or parse this DateTimeFormatterBuilder



appendFractionOfHour
public DateTimeFormatterBuilder appendFractionOfHour(int minDigits, int maxDigits)(Code)

Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to print or parse this DateTimeFormatterBuilder



appendFractionOfMinute
public DateTimeFormatterBuilder appendFractionOfMinute(int minDigits, int maxDigits)(Code)

Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to print or parse this DateTimeFormatterBuilder



appendFractionOfSecond
public DateTimeFormatterBuilder appendFractionOfSecond(int minDigits, int maxDigits)(Code)

Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to print or parse this DateTimeFormatterBuilder



appendHalfdayOfDayText
public DateTimeFormatterBuilder appendHalfdayOfDayText()(Code)
Instructs the printer to emit a locale-specific AM/PM text, and the parser to expect it. The parser is case-insensitive. this DateTimeFormatterBuilder



appendHourOfDay
public DateTimeFormatterBuilder appendHourOfDay(int minDigits)(Code)
Instructs the printer to emit a numeric hourOfDay field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendHourOfHalfday
public DateTimeFormatterBuilder appendHourOfHalfday(int minDigits)(Code)
Instructs the printer to emit a numeric hourOfHalfday field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendLiteral
public DateTimeFormatterBuilder appendLiteral(char c)(Code)
Instructs the printer to emit a specific character, and the parser to expect it. The parser is case-insensitive. this DateTimeFormatterBuilder



appendLiteral
public DateTimeFormatterBuilder appendLiteral(String text)(Code)
Instructs the printer to emit specific text, and the parser to expect it. The parser is case-insensitive. this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if text is null



appendMillisOfDay
public DateTimeFormatterBuilder appendMillisOfDay(int minDigits)(Code)
Instructs the printer to emit a numeric millisOfDay field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendMillisOfSecond
public DateTimeFormatterBuilder appendMillisOfSecond(int minDigits)(Code)
Instructs the printer to emit a numeric millisOfSecond field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendMinuteOfDay
public DateTimeFormatterBuilder appendMinuteOfDay(int minDigits)(Code)
Instructs the printer to emit a numeric minuteOfDay field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendMinuteOfHour
public DateTimeFormatterBuilder appendMinuteOfHour(int minDigits)(Code)
Instructs the printer to emit a numeric minuteOfHour field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendMonthOfYear
public DateTimeFormatterBuilder appendMonthOfYear(int minDigits)(Code)
Instructs the printer to emit a numeric monthOfYear field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendMonthOfYearShortText
public DateTimeFormatterBuilder appendMonthOfYearShortText()(Code)
Instructs the printer to emit a locale-specific monthOfYear text. The parser will accept a long or short monthOfYear text, case-insensitive. this DateTimeFormatterBuilder



appendMonthOfYearText
public DateTimeFormatterBuilder appendMonthOfYearText()(Code)
Instructs the printer to emit a short locale-specific monthOfYear text. The parser will accept a long or short monthOfYear text, case-insensitive. this DateTimeFormatterBuilder



appendOptional
public DateTimeFormatterBuilder appendOptional(DateTimeParser parser)(Code)
Appends just a parser element which is optional. With no matching printer, a printer cannot be built from this DateTimeFormatterBuilder. this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if parser is null or of an invalid type



appendPattern
public DateTimeFormatterBuilder appendPattern(String pattern)(Code)
Calls upon DateTimeFormat to parse the pattern and append the results into this builder.
Parameters:
  pattern - pattern specification
throws:
  IllegalArgumentException - if the pattern is invalid
See Also:   DateTimeFormat



appendSecondOfDay
public DateTimeFormatterBuilder appendSecondOfDay(int minDigits)(Code)
Instructs the printer to emit a numeric secondOfDay field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendSecondOfMinute
public DateTimeFormatterBuilder appendSecondOfMinute(int minDigits)(Code)
Instructs the printer to emit a numeric secondOfMinute field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendShortText
public DateTimeFormatterBuilder appendShortText(DateTimeFieldType fieldType)(Code)
Instructs the printer to emit a field value as short text, and the parser to expect text.
Parameters:
  fieldType - type of field to append this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if field type is null



appendSignedDecimal
public DateTimeFormatterBuilder appendSignedDecimal(DateTimeFieldType fieldType, int minDigits, int maxDigits)(Code)
Instructs the printer to emit a field value as a decimal number, and the parser to expect a signed decimal number.
Parameters:
  fieldType - type of field to append
Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to parse, or the estimatedmaximum number of digits to print this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if field type is null



appendText
public DateTimeFormatterBuilder appendText(DateTimeFieldType fieldType)(Code)
Instructs the printer to emit a field value as text, and the parser to expect text.
Parameters:
  fieldType - type of field to append this DateTimeFormatterBuilder
throws:
  IllegalArgumentException - if field type is null



appendTimeZoneId
public DateTimeFormatterBuilder appendTimeZoneId()(Code)
Instructs the printer to emit the identifier of the time zone. This field cannot currently be parsed. this DateTimeFormatterBuilder



appendTimeZoneName
public DateTimeFormatterBuilder appendTimeZoneName()(Code)
Instructs the printer to emit a locale-specific time zone name. A parser cannot be created from this builder if a time zone name is appended. this DateTimeFormatterBuilder



appendTimeZoneOffset
public DateTimeFormatterBuilder appendTimeZoneOffset(String zeroOffsetText, boolean showSeparators, int minFields, int maxFields)(Code)
Instructs the printer to emit text and numbers to display time zone offset from UTC. A parser will use the parsed time zone offset to adjust the datetime.
Parameters:
  zeroOffsetText - Text to use if time zone offset is zero. Ifnull, offset is always shown.
Parameters:
  showSeparators - If true, prints ':' separator before minute andsecond field and prints '.' separator before fraction field.
Parameters:
  minFields - minimum number of fields to print, stopping when nomore precision is required. 1=hours, 2=minutes, 3=seconds, 4=fraction
Parameters:
  maxFields - maximum number of fields to print this DateTimeFormatterBuilder



appendTimeZoneShortName
public DateTimeFormatterBuilder appendTimeZoneShortName()(Code)
Instructs the printer to emit a short locale-specific time zone name. A parser cannot be created from this builder if time zone name is appended. this DateTimeFormatterBuilder



appendTwoDigitWeekyear
public DateTimeFormatterBuilder appendTwoDigitWeekyear(int pivot)(Code)
Instructs the printer to emit a numeric weekyear field which always prints and parses two digits. A pivot year is used during parsing to determine the range of supported years as (pivot - 50) .. (pivot + 49).
 pivot   supported range   00 is   20 is   40 is   60 is   80 is
 ---------------------------------------------------------------
 1950      1900..1999      1900    1920    1940    1960    1980
 1975      1925..2024      2000    2020    1940    1960    1980
 2000      1950..2049      2000    2020    2040    1960    1980
 2025      1975..2074      2000    2020    2040    2060    1980
 2050      2000..2099      2000    2020    2040    2060    2080
 

Parameters:
  pivot - pivot weekyear to use when parsing this DateTimeFormatterBuilder



appendTwoDigitWeekyear
public DateTimeFormatterBuilder appendTwoDigitWeekyear(int pivot, boolean lenientParse)(Code)
Instructs the printer to emit a numeric weekyear field which always prints two digits. A pivot year is used during parsing to determine the range of supported years as (pivot - 50) .. (pivot + 49). If parse is instructed to be lenient and the digit count is not two, it is treated as an absolute weekyear. With lenient parsing, specifying a positive or negative sign before the weekyear also makes it absolute.
Parameters:
  pivot - pivot weekyear to use when parsing
Parameters:
  lenientParse - when true, if digit count is not two, it is treatedas an absolute weekyear this DateTimeFormatterBuilder
since:
   1.1



appendTwoDigitYear
public DateTimeFormatterBuilder appendTwoDigitYear(int pivot)(Code)
Instructs the printer to emit a numeric year field which always prints and parses two digits. A pivot year is used during parsing to determine the range of supported years as (pivot - 50) .. (pivot + 49).
 pivot   supported range   00 is   20 is   40 is   60 is   80 is
 ---------------------------------------------------------------
 1950      1900..1999      1900    1920    1940    1960    1980
 1975      1925..2024      2000    2020    1940    1960    1980
 2000      1950..2049      2000    2020    2040    1960    1980
 2025      1975..2074      2000    2020    2040    2060    1980
 2050      2000..2099      2000    2020    2040    2060    2080
 

Parameters:
  pivot - pivot year to use when parsing this DateTimeFormatterBuilder



appendTwoDigitYear
public DateTimeFormatterBuilder appendTwoDigitYear(int pivot, boolean lenientParse)(Code)
Instructs the printer to emit a numeric year field which always prints two digits. A pivot year is used during parsing to determine the range of supported years as (pivot - 50) .. (pivot + 49). If parse is instructed to be lenient and the digit count is not two, it is treated as an absolute year. With lenient parsing, specifying a positive or negative sign before the year also makes it absolute.
Parameters:
  pivot - pivot year to use when parsing
Parameters:
  lenientParse - when true, if digit count is not two, it is treatedas an absolute year this DateTimeFormatterBuilder
since:
   1.1



appendUnknownString
static void appendUnknownString(StringBuffer buf, int len)(Code)



appendWeekOfWeekyear
public DateTimeFormatterBuilder appendWeekOfWeekyear(int minDigits)(Code)
Instructs the printer to emit a numeric weekOfWeekyear field.
Parameters:
  minDigits - minumum number of digits to print this DateTimeFormatterBuilder



appendWeekyear
public DateTimeFormatterBuilder appendWeekyear(int minDigits, int maxDigits)(Code)
Instructs the printer to emit a numeric weekyear field.
Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to parse, or the estimatedmaximum number of digits to print this DateTimeFormatterBuilder



appendYear
public DateTimeFormatterBuilder appendYear(int minDigits, int maxDigits)(Code)
Instructs the printer to emit a numeric year field.
Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to parse, or the estimatedmaximum number of digits to print this DateTimeFormatterBuilder



appendYearOfCentury
public DateTimeFormatterBuilder appendYearOfCentury(int minDigits, int maxDigits)(Code)
Instructs the printer to emit a numeric year of century field.
Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to parse, or the estimatedmaximum number of digits to print this DateTimeFormatterBuilder



appendYearOfEra
public DateTimeFormatterBuilder appendYearOfEra(int minDigits, int maxDigits)(Code)
Instructs the printer to emit a numeric yearOfEra field.
Parameters:
  minDigits - minumum number of digits to print
Parameters:
  maxDigits - maximum number of digits to parse, or the estimatedmaximum number of digits to print this DateTimeFormatterBuilder



canBuildFormatter
public boolean canBuildFormatter()(Code)
Returns true if toFormatter can be called without throwing an UnsupportedOperationException. true if a formatter can be built



canBuildParser
public boolean canBuildParser()(Code)
Returns true if toParser can be called without throwing an UnsupportedOperationException. true if a parser can be built



canBuildPrinter
public boolean canBuildPrinter()(Code)
Returns true if toPrinter can be called without throwing an UnsupportedOperationException. true if a printer can be built



clear
public void clear()(Code)
Clears out all the appended elements, allowing this builder to be reused.



printUnknownString
static void printUnknownString(Writer out, int len) throws IOException(Code)



toFormatter
public DateTimeFormatter toFormatter()(Code)
Constructs a DateTimeFormatter using all the appended elements.

This is the main method used by applications at the end of the build process to create a usable formatter.

Subsequent changes to this builder do not affect the returned formatter.

The returned formatter may not support both printing and parsing. The methods DateTimeFormatter.isPrinter and DateTimeFormatter.isParser will help you determine the state of the formatter.
throws:
  UnsupportedOperationException - if neither printing nor parsing is supported




toParser
public DateTimeParser toParser()(Code)
Internal method to create a DateTimeParser instance using all the appended elements.

Most applications will not use this method. If you want a parser in an application, call DateTimeFormatterBuilder.toFormatter() and just use the parsing API.

Subsequent changes to this builder do not affect the returned parser.
throws:
  UnsupportedOperationException - if parsing is not supported




toPrinter
public DateTimePrinter toPrinter()(Code)
Internal method to create a DateTimePrinter instance using all the appended elements.

Most applications will not use this method. If you want a printer in an application, call DateTimeFormatterBuilder.toFormatter() and just use the printing API.

Subsequent changes to this builder do not affect the returned printer.
throws:
  UnsupportedOperationException - if printing is not supported




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.