@@ -92,7 +92,7 @@ public class DateTimeFormatter {
9292 /** The internal printer used to output the datetime. */
9393 private final InternalPrinter iPrinter ;
9494 /** The internal parser used to output the datetime. */
95- private final DateTimeParser iParser ;
95+ private final InternalParser iParser ;
9696 /** The locale to use for printing and parsing. */
9797 private final Locale iLocale ;
9898 /** Whether the offset is parsed. */
@@ -115,7 +115,7 @@ public class DateTimeFormatter {
115115 */
116116 public DateTimeFormatter (
117117 DateTimePrinter printer , DateTimeParser parser ) {
118- this (DateTimePrinterInternalPrinter .of (printer ), parser );
118+ this (DateTimePrinterInternalPrinter .of (printer ), DateTimeParserInternalParser . of ( parser ) );
119119 }
120120
121121 /**
@@ -126,7 +126,7 @@ public DateTimeFormatter(
126126 * @param parser the internal parser, null if cannot parse
127127 */
128128 DateTimeFormatter (
129- InternalPrinter printer , DateTimeParser parser ) {
129+ InternalPrinter printer , InternalParser parser ) {
130130 super ();
131131 iPrinter = printer ;
132132 iParser = parser ;
@@ -142,7 +142,7 @@ public DateTimeFormatter(
142142 * Constructor.
143143 */
144144 private DateTimeFormatter (
145- InternalPrinter printer , DateTimeParser parser ,
145+ InternalPrinter printer , InternalParser parser ,
146146 Locale locale , boolean offsetParsed ,
147147 Chronology chrono , DateTimeZone zone ,
148148 Integer pivotYear , int defaultYear ) {
@@ -200,6 +200,10 @@ public boolean isParser() {
200200 * @return the internal parser; is null if parsing not supported
201201 */
202202 public DateTimeParser getParser () {
203+ return InternalParserDateTimeParser .of (iParser );
204+ }
205+
206+ InternalParser getParser0 () {
203207 return iParser ;
204208 }
205209
@@ -728,7 +732,7 @@ private InternalPrinter requirePrinter() {
728732 * @throws IllegalArgumentException if any field is out of range
729733 */
730734 public int parseInto (ReadWritableInstant instant , String text , int position ) {
731- DateTimeParser parser = requireParser ();
735+ InternalParser parser = requireParser ();
732736 if (instant == null ) {
733737 throw new IllegalArgumentException ("Instant must not be null" );
734738 }
@@ -770,7 +774,7 @@ public int parseInto(ReadWritableInstant instant, String text, int position) {
770774 * @throws IllegalArgumentException if the text to parse is invalid
771775 */
772776 public long parseMillis (String text ) {
773- DateTimeParser parser = requireParser ();
777+ InternalParser parser = requireParser ();
774778 Chronology chrono = selectChronology (iChrono );
775779 DateTimeParserBucket bucket = new DateTimeParserBucket (0 , chrono , iLocale , iPivotYear , iDefaultYear );
776780 return bucket .doParseMillis (parser , text );
@@ -827,7 +831,7 @@ public LocalTime parseLocalTime(String text) {
827831 * @since 2.0
828832 */
829833 public LocalDateTime parseLocalDateTime (String text ) {
830- DateTimeParser parser = requireParser ();
834+ InternalParser parser = requireParser ();
831835
832836 Chronology chrono = selectChronology (null ).withUTC (); // always use UTC, avoiding DST gaps
833837 DateTimeParserBucket bucket = new DateTimeParserBucket (0 , chrono , iLocale , iPivotYear , iDefaultYear );
@@ -868,7 +872,7 @@ public LocalDateTime parseLocalDateTime(String text) {
868872 * @throws IllegalArgumentException if the text to parse is invalid
869873 */
870874 public DateTime parseDateTime (String text ) {
871- DateTimeParser parser = requireParser ();
875+ InternalParser parser = requireParser ();
872876
873877 Chronology chrono = selectChronology (null );
874878 DateTimeParserBucket bucket = new DateTimeParserBucket (0 , chrono , iLocale , iPivotYear , iDefaultYear );
@@ -913,7 +917,7 @@ public DateTime parseDateTime(String text) {
913917 * @throws IllegalArgumentException if the text to parse is invalid
914918 */
915919 public MutableDateTime parseMutableDateTime (String text ) {
916- DateTimeParser parser = requireParser ();
920+ InternalParser parser = requireParser ();
917921
918922 Chronology chrono = selectChronology (null );
919923 DateTimeParserBucket bucket = new DateTimeParserBucket (0 , chrono , iLocale , iPivotYear , iDefaultYear );
@@ -945,8 +949,8 @@ public MutableDateTime parseMutableDateTime(String text) {
945949 *
946950 * @throws UnsupportedOperationException if parsing is not supported
947951 */
948- private DateTimeParser requireParser () {
949- DateTimeParser parser = iParser ;
952+ private InternalParser requireParser () {
953+ InternalParser parser = iParser ;
950954 if (parser == null ) {
951955 throw new UnsupportedOperationException ("Parsing not supported" );
952956 }
0 commit comments