Examples of DateAttribute


Examples of org.geomajas.layer.feature.attribute.DateAttribute

      this.attribute = new StringAttribute(value);
      this.info = new PrimitiveAttributeInfo(name, label, type);
    }

    AttributeInfoPair(String name, String label, Date value) {
      this.attribute = new DateAttribute(value);
      this.info = new PrimitiveAttributeInfo(name, label, PrimitiveType.DATE);
    }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.DateAttribute

          case CURRENCY:
            return new CurrencyAttribute();
          case STRING:
            return new StringAttribute();
          case DATE:
            return new DateAttribute();
          case URL:
            return new UrlAttribute();
          case IMGURL:
            return new ImageUrlAttribute();
        }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.attr.DateAttribute

            break;
        }
        case ID_DATE_ADD_YEARMONTHDURATION:
        case ID_DATE_SUBTRACT_YEARMONTHDURATION: {
            DateAttribute date = (DateAttribute) argValues[0];
            YearMonthDurationAttribute duration =
                (YearMonthDurationAttribute) argValues[1];
           
            // Decide what sign goes with duration
            int sign = 1;
            if (getFunctionId() == ID_DATE_SUBTRACT_YEARMONTHDURATION)
                sign = -sign;
            if (duration.isNegative())
                sign = -sign;

            // Add (or subtract) the years and months.
            Calendar cal = new GregorianCalendar();
            cal.setTime(date.getValue());
            long years = sign * duration.getYears();
            long months = sign * duration.getMonths();
            if ((years > Integer.MAX_VALUE) || (years < Integer.MIN_VALUE))
                return makeProcessingError("years too large");
            if ((months > Integer.MAX_VALUE) || (months < Integer.MIN_VALUE))
                return makeProcessingError("months too large");

            cal.add(Calendar.YEAR, (int) years);
            cal.add(Calendar.MONTH, (int) months);

            attrResult = new DateAttribute(cal.getTime(),
                                           date.getTimeZone(),
                                           date.getDefaultedTimeZone());

            break;
        }
        }

View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.attr.DateAttribute

        long millis = dateTimeHelper();

        if (useCachedEnvValues)
            return currentDate;
        else
            return new DateAttribute(new Date(millis));
    }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.attr.DateAttribute

        } else {
            // we're caching, so resolve all three values, making sure
            // to use clean copies of the date object since it may be
            // modified when creating the attributes
            currentTime = new TimeAttribute(time);
            currentDate = new DateAttribute(new Date(millis));
            currentDateTime = new DateTimeAttribute(new Date(millis));
        }
       
        return -1;
    }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.attr.DateAttribute

        long millis = dateTimeHelper();

        if (useCachedEnvValues)
            return currentDate;
        else
            return new DateAttribute(new Date(millis));
    }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.attr.DateAttribute

        } else {
            // we're caching, so resolve all three values, making sure
            // to use clean copies of the date object since it may be
            // modified when creating the attributes
            currentTime = new TimeAttribute(time);
            currentDate = new DateAttribute(new Date(millis));
            currentDateTime = new DateTimeAttribute(new Date(millis));
        }
       
        return -1;
    }
View Full Code Here

Examples of org.jboss.security.xacml.sunxacml.attr.DateAttribute

            break;
        }
        case ID_DATE_ADD_YEARMONTHDURATION:
        case ID_DATE_SUBTRACT_YEARMONTHDURATION: {
            DateAttribute date = (DateAttribute) argValues[0];
            YearMonthDurationAttribute duration =
                (YearMonthDurationAttribute) argValues[1];
           
            // Decide what sign goes with duration
            int sign = 1;
            if (getFunctionId() == ID_DATE_SUBTRACT_YEARMONTHDURATION)
                sign = -sign;
            if (duration.isNegative())
                sign = -sign;

            // Add (or subtract) the years and months.
            Calendar cal = new GregorianCalendar();
            cal.setTime(date.getValue());
            long years = sign * duration.getYears();
            long months = sign * duration.getMonths();
            if ((years > Integer.MAX_VALUE) || (years < Integer.MIN_VALUE))
                return makeProcessingError("years too large");
            if ((months > Integer.MAX_VALUE) || (months < Integer.MIN_VALUE))
                return makeProcessingError("months too large");

            cal.add(Calendar.YEAR, (int) years);
            cal.add(Calendar.MONTH, (int) months);

            attrResult = new DateAttribute(cal.getTime(),
                                           date.getTimeZone(),
                                           date.getDefaultedTimeZone());

            break;
        }
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.