1 11 package com.hp.hpl.jena.datatypes.xsd.impl; 12 13 import com.hp.hpl.jena.datatypes.xsd.AbstractDateTime; 14 import com.hp.hpl.jena.datatypes.xsd.XSDDateTime; 15 16 23 public class XSDMonthDayType extends XSDAbstractDateTimeType { 24 25 28 public XSDMonthDayType(String typename) { 29 super(typename); 30 } 31 32 private final static int MONTHDAY_SIZE = 7; 34 35 40 public Object parseValidated(String str) { 41 int len = str.length(); 42 int[] date = new int[TOTAL_SIZE]; 43 int[] timeZone = new int[2]; 44 45 date[CY]=YEAR; 47 48 date[M]=parseInt(str, 2, 4); 49 int start=5; 50 51 date[D]=parseInt(str, start, start+2); 52 53 if ( MONTHDAY_SIZE<len ) { 54 int sign = findUTCSign(str, MONTHDAY_SIZE, len); 55 getTimeZone(str, date, sign, len, timeZone); 56 } 57 58 if ( date[utc]!=0 && date[utc]!='Z' ) { 59 AbstractDateTime.normalize(date, timeZone); 60 } 61 62 return new XSDDateTime(date, MONTH_MASK | DAY_MASK); 63 } 64 65 } 66 67 68 69 98 | Popular Tags |