protected DateTimeData parse(String str) throws SchemaDateTimeException {
  DateTimeData date=new DateTimeData(str,this);
  int len=str.length();
  int start=0;
  if (str.charAt(0) == '-') {
    start=1;
  }
  int sign=findUTCSign(str,start,len);
  final int length=((sign == -1) ? len : sign) - start;
  if (length < 4) {
    throw new RuntimeException("Year must have 'CCYY' format");
  }
 else   if (length > 4 && str.charAt(start) == '0') {
    throw new RuntimeException("Leading zeros are required if the year value would otherwise have fewer than four digits; otherwise they are forbidden");
  }
  if (sign == -1) {
    date.year=parseIntYear(str,len);
  }
 else {
    date.year=parseIntYear(str,sign);
    getTimeZone(str,date,sign,len);
  }
  date.month=MONTH;
  date.day=1;
  validateDateTime(date);
  saveUnnormalized(date);
  if (date.utc != 0 && date.utc != 'Z') {
    normalize(date);
  }
  date.position=0;
  return date;
}

protected DateTimeData parse ( String str ) throws SchemaDateTimeException { DateTimeData date = new DateTimeData ( str , this ) ; int len = str . length ( ) ; int start = 0 ; if ( str . charAt ( 0 ) == '-' ) { start = 1 ; } int sign = findUTCSign ( str , start , len ) ; final int length = ( ( sign == - 1 ) ? len : sign ) - start ; if ( length < 4 ) { throw new RuntimeException ( "Year must have 'CCYY' format" ) ; } else if ( length > 4 && str . charAt ( start ) == '0' ) { throw new RuntimeException ( "Leading zeros are required if the year value would otherwise have fewer than four digits; otherwise they are forbidden" ) ; } if ( sign == - 1 ) { date . year = parseIntYear ( str , len ) ; } else { date . year = parseIntYear ( str , sign ) ; getTimeZone ( str , date , sign , len ) ; } date . month = MONTH ; date . day = 1 ; validateDateTime ( date ) ; saveUnnormalized ( date ) ; if ( date . utc != 0 && date . utc != 'Z' ) { normalize ( date ) ; } date . position = 0 ; return date ; }
parses , validates and computes normalized version of gyear object
