本文整理汇总了Java中org.apache.xerces.xs.XSConstants.SHORT_DT属性的典型用法代码示例。如果您正苦于以下问题:Java XSConstants.SHORT_DT属性的具体用法?Java XSConstants.SHORT_DT怎么用?Java XSConstants.SHORT_DT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.xerces.xs.XSConstants
的用法示例。
在下文中一共展示了XSConstants.SHORT_DT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLeafType
private String getLeafType(int value){
switch(value){
case XSConstants.BOOLEAN_DT:
return Types.BOOLEAN;
case XSConstants.STRING_DT:
return Types.STRING;
case XSConstants.BYTE_DT:
case XSConstants.SHORT_DT:
case XSConstants.INTEGER_DT:
case XSConstants.INT_DT:
case XSConstants.POSITIVEINTEGER_DT:
case XSConstants.NEGATIVEINTEGER_DT:
case XSConstants.NONPOSITIVEINTEGER_DT:
case XSConstants.NONNEGATIVEINTEGER_DT:
return Types.INTEGER;
case XSConstants.LONG_DT:
return Types.LONG;
case XSConstants.DECIMAL_DT:
case XSConstants.FLOAT_DT:
case XSConstants.DOUBLE_DT:
return Types.DOUBLE;
case XSConstants.DATE_DT:
return Types.DATE;
case XSConstants.TIME_DT:
case XSConstants.DATETIME_DT:
return Types.DATETIME;
default:
return Types.STRING;
}
}
示例2: endElement
public void endElement(String uri, String localName, String qName) throws SAXException {
ElementPSVI psvi = provider.getElementPSVI();
if(psvi != null) {
//If there was an element content
Object value = psvi.getActualNormalizedValue();
short type = psvi.getActualNormalizedValueType();
if(value != null) {
switch(type) {
case XSConstants.INTEGER_DT:
case XSConstants.DECIMAL_DT:
case XSConstants.INT_DT:
case XSConstants.LONG_DT:
case XSConstants.SHORT_DT:
case XSConstants.BYTE_DT:
case XSConstants.UNSIGNEDBYTE_DT:
case XSConstants.UNSIGNEDINT_DT:
case XSConstants.UNSIGNEDLONG_DT:
case XSConstants.UNSIGNEDSHORT_DT:
XSDecimal decimal = (XSDecimal)value;
System.out.println(decimal.getInt());
break;
case XSConstants.DATE_DT:
case XSConstants.DATETIME_DT:
case XSConstants.GDAY_DT:
case XSConstants.GMONTH_DT:
case XSConstants.GMONTHDAY_DT:
case XSConstants.GYEAR_DT:
case XSConstants.GYEARMONTH_DT:
case XSConstants.DURATION_DT:
case XSConstants.TIME_DT:
XSDateTime dt = (XSDateTime)value;
System.out.println(dt.getDays());
break;
case XSConstants.FLOAT_DT:
XSFloat f = (XSFloat)value;
System.out.println(f.getValue());
break;
case XSConstants.DOUBLE_DT:
XSDouble d = (XSDouble)value;
System.out.println(d.getValue());
break;
case XSConstants.HEXBINARY_DT:
case XSConstants.BASE64BINARY_DT:
ByteList list = (ByteList)value;
System.out.println(list.getLength());
break;
case XSConstants.LIST_DT:
case XSConstants.LISTOFUNION_DT:
ObjectList l = (ObjectList)value;
System.out.println(l.getLength());
break;
case XSConstants.QNAME_DT:
XSQName qname = (XSQName)value;
System.out.println(qname.getXNIQName());
break;
default:
System.out.println("error!!!");
}
}
}
super.endElement(uri, localName, qName);
}