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 XSDDayType extends XSDAbstractDateTimeType { 24 25 28 public XSDDayType(String typename) { 29 super(typename); 30 } 31 32 private final static int DAY_SIZE=5; 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 date[M]=MONTH; 48 49 date[D]=parseInt(str, 3,5); 50 51 if ( DAY_SIZE<len ) { 52 int sign = findUTCSign(str, DAY_SIZE, len); 53 getTimeZone(str, date, sign, len, timeZone); 54 } 55 56 if ( date[utc]!=0 && date[utc]!='Z' ) { 57 AbstractDateTime.normalize(date, timeZone); 58 } 59 60 return new XSDDateTime(date, DAY_MASK); 61 } 62 63 } 64 65 66 95 | Popular Tags |