You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@apache.org on 2004/12/17 21:21:25 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/xs/datatypes XSDateTime.java

ankitp      2004/12/17 12:21:25

  Modified:    java/src/org/apache/xerces/impl/dv/xs YearDV.java
                        TimeDV.java DateTimeDV.java DateDV.java
                        MonthDayDV.java DayDV.java AbstractDateTimeDV.java
                        DurationDV.java XSSimpleTypeDecl.java
                        YearMonthDV.java MonthDV.java
               java/src/org/apache/xerces/xs/datatypes XSDateTime.java
  Log:
  expose lexical value for date-time related data types
  provide access to (min/max) Exclusive/Inclusive objects
  
  Revision  Changes    Path
  1.15      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/YearDV.java
  
  Index: YearDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/YearDV.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- YearDV.java	29 Nov 2004 18:21:45 -0000	1.14
  +++ YearDV.java	17 Dec 2004 20:21:24 -0000	1.15
  @@ -55,7 +55,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException{
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           // check for preceding '-' sign
  
  
  
  1.16      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/TimeDV.java
  
  Index: TimeDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/TimeDV.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TimeDV.java	29 Nov 2004 18:21:45 -0000	1.15
  +++ TimeDV.java	17 Dec 2004 20:21:24 -0000	1.16
  @@ -55,7 +55,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException{
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           // time
  
  
  
  1.14      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DateTimeDV.java
  
  Index: DateTimeDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DateTimeDV.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DateTimeDV.java	29 Nov 2004 18:21:45 -0000	1.13
  +++ DateTimeDV.java	17 Dec 2004 20:21:24 -0000	1.14
  @@ -48,7 +48,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException {
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           int end = indexOf (str, 0, len, 'T');
  
  
  
  1.17      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DateDV.java
  
  Index: DateDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DateDV.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DateDV.java	29 Nov 2004 18:21:45 -0000	1.16
  +++ DateDV.java	17 Dec 2004 20:21:24 -0000	1.17
  @@ -47,7 +47,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException {
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           int end = getDate(str, 0, len, date);
  
  
  
  1.15      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/MonthDayDV.java
  
  Index: MonthDayDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/MonthDayDV.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- MonthDayDV.java	29 Nov 2004 18:21:45 -0000	1.14
  +++ MonthDayDV.java	17 Dec 2004 20:21:24 -0000	1.15
  @@ -58,7 +58,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException{
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           //initialize
  
  
  
  1.15      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DayDV.java
  
  Index: DayDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DayDV.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DayDV.java	2 Dec 2004 16:14:56 -0000	1.14
  +++ DayDV.java	17 Dec 2004 20:21:24 -0000	1.15
  @@ -51,7 +51,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException {
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           if (str.charAt(0)!='-' || str.charAt(1)!='-' || str.charAt(2)!='-') {
  
  
  
  1.28      +13 -4     xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java
  
  Index: AbstractDateTimeDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- AbstractDateTimeDV.java	16 Dec 2004 16:23:28 -0000	1.27
  +++ AbstractDateTimeDV.java	17 Dec 2004 20:21:24 -0000	1.28
  @@ -99,7 +99,7 @@
   		}
   		short c1, c2;
   		
  -		DateTimeData tempDate = new DateTimeData(this);
  +		DateTimeData tempDate = new DateTimeData(null, this);
   		
   		if ( date1.utc=='Z' ) {
   			
  @@ -804,6 +804,7 @@
   		int year, month, day, hour, minute, utc;
   		double second;
   		int timezoneHr, timezoneMin;
  +        String originalValue;
   		
   		// used for comparisons - to decide the 'interesting' portions of
   		// a date/time based data type.
  @@ -813,11 +814,12 @@
   		// statically created XXXDV objects, so this won't cause any GC problem.
   		final AbstractDateTimeDV type;
   		private String canonical;
  -		public DateTimeData(AbstractDateTimeDV type) {
  +		public DateTimeData(String originalValue, AbstractDateTimeDV type) {
  +            this.originalValue = originalValue;
   			this.type = type;
   		}
   		public DateTimeData(int year, int month, int day, int hour, int minute,
  -				double second, int utc, AbstractDateTimeDV type) {
  +				double second, int utc, String originalValue, AbstractDateTimeDV type) {
   			this.year = year;
   			this.month = month;
   			this.day = day;
  @@ -826,6 +828,7 @@
   			this.second = second;
   			this.utc = utc;
   			this.type = type;
  +            this.originalValue = originalValue;
   		}
   		public boolean equals(Object obj) {
   			if (!(obj instanceof DateTimeData))
  @@ -892,5 +895,11 @@
   		public int getTimeZoneMin() {
   			return timezoneMin;
   		}
  +        /**
  +         * @return Returns the originalValue.
  +         */
  +        public String getLexicalValue() {
  +            return originalValue;
  +        }
   	}
   }
  
  
  
  1.16      +8 -8      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DurationDV.java
  
  Index: DurationDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/DurationDV.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DurationDV.java	29 Nov 2004 18:21:45 -0000	1.15
  +++ DurationDV.java	17 Dec 2004 20:21:24 -0000	1.16
  @@ -40,10 +40,10 @@
       //
       // the dates are in format: {CCYY,MM,DD, H, S, M, MS, timezone}
       private final static DateTimeData[] DATETIMES= {
  -        new DateTimeData(1696, 9, 1, 0, 0, 0, 'Z', null),
  -        new DateTimeData(1697, 2, 1, 0, 0, 0, 'Z', null),
  -        new DateTimeData(1903, 3, 1, 0, 0, 0, 'Z', null),
  -        new DateTimeData(1903, 7, 1, 0, 0, 0, 'Z', null)};
  +        new DateTimeData(1696, 9, 1, 0, 0, 0, 'Z', null, null),
  +        new DateTimeData(1697, 2, 1, 0, 0, 0, 'Z', null, null),
  +        new DateTimeData(1903, 3, 1, 0, 0, 0, 'Z', null, null),
  +        new DateTimeData(1903, 7, 1, 0, 0, 0, 'Z', null, null)};
   
       public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException{
           try{
  @@ -63,7 +63,7 @@
        */
       protected DateTimeData parse(String str, int durationType) throws SchemaDateTimeException{
           int len = str.length();
  -        DateTimeData date= new DateTimeData(this);
  +        DateTimeData date= new DateTimeData(str, this);
           
           int start = 0;
           char c=str.charAt(start++);
  @@ -209,8 +209,8 @@
           }
   
           DateTimeData[] result = new DateTimeData[2];
  -        result[0] = new DateTimeData(this);
  -        result[1] = new DateTimeData(this);
  +        result[0] = new DateTimeData(null, this);
  +        result[1] = new DateTimeData(null, this);
   
           //long comparison algorithm is required
           DateTimeData tempA = addDuration (date1, DATETIMES[0], result[0]);
  
  
  
  1.65      +17 -1     xml-xerces/java/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
  
  Index: XSSimpleTypeDecl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- XSSimpleTypeDecl.java	15 Dec 2004 20:50:07 -0000	1.64
  +++ XSSimpleTypeDecl.java	17 Dec 2004 20:21:24 -0000	1.65
  @@ -2989,6 +2989,22 @@
   		return (fMultiValueFacets != null) ?
   				fMultiValueFacets : XSObjectListImpl.EMPTY_LIST;
   	}
  +    
  +    public Object getMinInclusiveValue() {
  +        return fMinInclusive;
  +    }
  +    
  +    public Object getMinExclusiveValue() {
  +        return fMinExclusive;
  +    }
  +    
  +    public Object getMaxInclusiveValue() {
  +        return fMaxInclusive;
  +    }
  +    
  +    public Object getMaxExclusiveValue() {
  +        return fMaxExclusive;
  +    }
   	
   	private static final class XSFacetImpl implements XSFacet {
   		final short kind;
  
  
  
  1.15      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/YearMonthDV.java
  
  Index: YearMonthDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/YearMonthDV.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- YearMonthDV.java	29 Nov 2004 18:21:45 -0000	1.14
  +++ YearMonthDV.java	17 Dec 2004 20:21:24 -0000	1.15
  @@ -54,7 +54,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException{
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           // get date
  
  
  
  1.17      +2 -2      xml-xerces/java/src/org/apache/xerces/impl/dv/xs/MonthDV.java
  
  Index: MonthDV.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/MonthDV.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- MonthDV.java	29 Nov 2004 18:21:45 -0000	1.16
  +++ MonthDV.java	17 Dec 2004 20:21:24 -0000	1.17
  @@ -55,7 +55,7 @@
        * @exception SchemaDateTimeException Invalid lexical representation
        */
       protected DateTimeData parse(String str) throws SchemaDateTimeException{
  -        DateTimeData date = new DateTimeData(this);
  +        DateTimeData date = new DateTimeData(str, this);
           int len = str.length();
   
           //set constants
  
  
  
  1.4       +6 -1      xml-xerces/java/src/org/apache/xerces/xs/datatypes/XSDateTime.java
  
  Index: XSDateTime.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xs/datatypes/XSDateTime.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XSDateTime.java	7 Dec 2004 15:17:49 -0000	1.3
  +++ XSDateTime.java	17 Dec 2004 20:21:25 -0000	1.4
  @@ -71,4 +71,9 @@
   	 * @return int
   	 */
   	public int getTimeZoneMin();
  +    
  +    /**
  +     * @return string
  +     */
  +    public String getLexicalValue();
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org