当前位置: 首页>>代码示例>>Java>>正文


Java XSConstants.DECIMAL_DT属性代码示例

本文整理汇总了Java中org.apache.xerces.xs.XSConstants.DECIMAL_DT属性的典型用法代码示例。如果您正苦于以下问题:Java XSConstants.DECIMAL_DT属性的具体用法?Java XSConstants.DECIMAL_DT怎么用?Java XSConstants.DECIMAL_DT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.xerces.xs.XSConstants的用法示例。


在下文中一共展示了XSConstants.DECIMAL_DT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertToPrimitiveKind

private short convertToPrimitiveKind(short valueType) {
    /** Primitive datatypes. */
    if (valueType <= XSConstants.NOTATION_DT) {
        return valueType;
    }
    /** Types derived from string. */
    if (valueType <= XSConstants.ENTITY_DT) {
        return XSConstants.STRING_DT;
    }
    /** Types derived from decimal. */
    if (valueType <= XSConstants.POSITIVEINTEGER_DT) {
        return XSConstants.DECIMAL_DT;
    }
    /** Other types. */
    return valueType;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:16,代码来源:XSSimpleTypeDecl.java

示例2: convertToPrimitiveKind

/**
 * Returns the primitive type of the given type.
 * @param valueType A value type as defined in XSConstants.
 * @return The primitive type from which valueType was derived.
 */
private static short convertToPrimitiveKind(short valueType) {
    /** Primitive datatypes. */
    if (valueType <= XSConstants.NOTATION_DT) {
        return valueType;
    }
    /** Types derived from string. */
    if (valueType <= XSConstants.ENTITY_DT) {
        return XSConstants.STRING_DT;
    }
    /** Types derived from decimal. */
    if (valueType <= XSConstants.POSITIVEINTEGER_DT) {
        return XSConstants.DECIMAL_DT;
    }
    /** Other types. */
    return valueType;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:21,代码来源:ValidatedInfo.java

示例3: getNumericType

public static RDFDatatype getNumericType(RDFDatatype lhs, RDFDatatype rhs)
{
	int lhsType = getNumericType(lhs);
	int rhsType = getNumericType(rhs);
	
	if (lhsType == XSConstants.INTEGER_DT) {
		if (rhsType == XSConstants.INTEGER_DT)
			return XSDDatatype.XSDinteger;
		if (rhsType == XSConstants.DECIMAL_DT)
			return XSDDatatype.XSDdecimal;
		if (rhsType == XSConstants.FLOAT_DT)
			return XSDDatatype.XSDfloat;
		
		return XSDDatatype.XSDdouble;
	} else if (lhsType == XSConstants.DECIMAL_DT) {
		if (rhsType == XSConstants.INTEGER_DT || rhsType == XSConstants.DECIMAL_DT)
			return XSDDatatype.XSDdecimal;
		if (rhsType == XSConstants.FLOAT_DT)
			return XSDDatatype.XSDfloat;
		
		return XSDDatatype.XSDdouble;
	} else if (lhsType == XSConstants.FLOAT_DT) {
		if (rhsType == XSConstants.INTEGER_DT || rhsType == XSConstants.DECIMAL_DT || rhsType == XSConstants.FLOAT_DT)
			return XSDDatatype.XSDfloat;
		
		return XSDDatatype.XSDdouble;
	} else if (lhsType == XSConstants.DOUBLE_DT) {
		return XSDDatatype.XSDdouble;
	}
	
	throw new IllegalArgumentException();
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:32,代码来源:XSD.java

示例4: 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;
    }
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:30,代码来源:GenerateXSDNodeTree.java

示例5: 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);
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:69,代码来源:DatatypeInterfaceUsage.java


注:本文中的org.apache.xerces.xs.XSConstants.DECIMAL_DT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。