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


Java ItemType类代码示例

本文整理汇总了Java中net.sf.saxon.type.ItemType的典型用法代码示例。如果您正苦于以下问题:Java ItemType类的具体用法?Java ItemType怎么用?Java ItemType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: sequenceToAttributeCollection

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
protected Collection<Attribute> sequenceToAttributeCollection(Sequence seq) throws XPathException {
  ArrayList<Attribute> attrs = new ArrayList<Attribute>();
  Item item;
  SequenceIterator iter = seq.iterate();
  while ((item = iter.next()) != null) {                
    Object value;
    String type;
    boolean isSerialized;
    if (item instanceof NodeInfo) {
      value = serialize((NodeInfo) item);
      type = "node()";
      isSerialized = true;
    } else {                             
      value = SequenceTool.convertToJava(item);
      ItemType itemType = Type.getItemType(item, null);
      type = itemType.toString();
      isSerialized = false;
    }
    attrs.add(new Attribute(value, type, isSerialized));
  }
  return attrs;
}
 
开发者ID:Armatiek,项目名称:xslweb,代码行数:23,代码来源:ExtensionFunctionCall.java

示例2: createValue

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
private Value createValue(ValueFacade expression) throws XPathException {
  final TypeHierarchy typeHierarchy = myXPathContext.getConfiguration().getTypeHierarchy();
  final ItemType itemType = expression.getItemType(typeHierarchy);

  final SequenceIterator it = expression.iterate(myXPathContext);
  Item value = null;
  if (it.next() != null) {
    value = it.current();
  }
  if (it.next() == null) {
    return new SingleValue(value, itemType);        
  }
  return new SequenceValue(value, it, itemType);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:Saxon9StyleFrame.java

示例3: SequenceValue

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public SequenceValue(Item value, SequenceIterator it, ItemType type) throws XPathException {
  String s = "(" + value.getStringValue() + ", " + it.current().getStringValue();
  while (it.next() != null) {
    s += ", " + it.current().getStringValue();
  }
  s += ")";
  myValue = s;
  myItemType = type;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:Saxon9StyleFrame.java

示例4: getItemType

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public ItemType getItemType(TypeHierarchy hierarchy) {
  if (myValue instanceof net.sf.saxon.value.Value) {
    return ((net.sf.saxon.value.Value)myValue).getItemType(hierarchy);
  }
  if (myValue instanceof Item) {
    return Type.getItemType((Item)myValue, hierarchy);
  }
  return AnyItemType.getInstance();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:Saxon9StyleFrame.java

示例5: getArgumentTypes

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
@Override
public SequenceType[] getArgumentTypes() {
  // 1/ element(http:request)
  final int one = StaticProperty.EXACTLY_ONE;
  final int kind = Type.ELEMENT;
  final String uri = HttpConstants.HTTP_CLIENT_NS_URI;
  final NamePool pool = myConfig.getNamePool();
  final ItemType itype = new NameTest(kind, uri, "request", pool);
  SequenceType stype1 = SequenceType.makeSequenceType(itype, one); // 2/ xs:string?
  SequenceType stype2 = SequenceType.OPTIONAL_STRING; // 3/ item()*
  SequenceType stype3 = SequenceType.ANY_SEQUENCE; // 1/, 2/ and 3/
  return new SequenceType[] { stype1, stype2, stype3 };
}
 
开发者ID:Armatiek,项目名称:xslweb,代码行数:14,代码来源:SendRequestFunction.java

示例6: type2Sequence

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public static SequenceType type2Sequence(DataType type) {
	ItemType it = type2Item(type.getType());
	int cardinality;
	switch (type.getCardinality()) {
		case one_or_more: cardinality = StaticProperty.ALLOWS_ONE_OR_MORE; break; 
		case zero_or_one: cardinality = StaticProperty.ALLOWS_ZERO_OR_ONE; break; 
		case zero_or_more: cardinality = StaticProperty.ALLOWS_ZERO_OR_MORE; break;
		default: cardinality = StaticProperty.ALLOWS_ONE;  
	}
	return SequenceType.makeSequenceType(it, cardinality);
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:12,代码来源:SaxonUtils.java

示例7: getTypeName

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public static String getTypeName(ItemType type) {
	if (type.isAtomicType()) {
		return type.getAtomizedItemType().getTypeName().getLocalPart();
	}
	String result = type.toString();
	// delete () at the end
	return result.substring(0, result.length() - 2);
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:9,代码来源:SaxonUtils.java

示例8: typeCheck

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public Expression typeCheck(StaticContext env, ItemType contextItemType) throws XPathException 
{
    for (Entry<String, Expression> attrib : attribs.entrySet()) {
      attrib.setValue(attrib.getValue().typeCheck(env, contextItemType));
      adoptChildExpression(attrib.getValue());
    }
    if (content != null) {
        content = content.typeCheck(env, contextItemType);
        adoptChildExpression(content);
    }
    return this;
}
 
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:13,代码来源:InstructionWithContent.java

示例9: optimize

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType) throws XPathException 
{
     for (Entry<String, Expression> attrib : attribs.entrySet()) {
       Expression exp = attrib.getValue();
       exp = exp.optimize(opt, env, contextItemType);
       attrib.setValue(exp);
       adoptChildExpression(exp);
     }
     
     if (content != null) {
         content = content.optimize(opt, env, contextItemType);
         adoptChildExpression(content);
     }
     return this;
 }
 
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:16,代码来源:InstructionWithContent.java

示例10: iterate

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public SequenceIterator iterate(XPathContext context) throws XPathException {
    Expression[] argExpressions = getArguments();
    ValueRepresentation vr = ExpressionTool.lazyEvaluate(argExpressions[0],
            context, 1);
    ItemType it = Value.asValue(vr).getItemType(
            context.getConfiguration().getTypeHierarchy());
    String type = getTypeName(it);
    Value v = Value.convertJavaObjectToXPath(type,
            SequenceType.SINGLE_STRING, context);
    return v.iterate();
}
 
开发者ID:opengeospatial,项目名称:teamengine,代码行数:12,代码来源:GetTypeFunctionCall.java

示例11: getType

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public static String getType(Expression expr, XPathContext context)
        throws XPathException {
    ValueRepresentation vr = ExpressionTool.lazyEvaluate(expr, context, 1);
    ItemType it = Value.asValue(vr).getItemType(
            context.getConfiguration().getTypeHierarchy());
    if (it instanceof SchemaType) {
        return "xs:" + ((SchemaType) it).getName();
    }
    return "xs:any";
}
 
开发者ID:opengeospatial,项目名称:teamengine,代码行数:11,代码来源:TEXSLFunctionCall.java

示例12: SingleValue

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
public SingleValue(Item value, ItemType itemType) {
  myValue = value;
  myItemType = itemType;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:Saxon9StyleFrame.java

示例13: getResultType

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
@Override
public SequenceType getResultType(SequenceType[] params) {
  final int more = StaticProperty.ALLOWS_ONE_OR_MORE;
  final ItemType itype = AnyItemType.getInstance();
  return SequenceType.makeSequenceType(itype, more);
}
 
开发者ID:Armatiek,项目名称:xslweb,代码行数:7,代码来源:SendRequestFunction.java

示例14: getItemType

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
@Override
public ItemType getItemType(TypeHierarchy th) {
	return null;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:5,代码来源:SaxonXQueryExpression.java

示例15: getItemType

import net.sf.saxon.type.ItemType; //导入依赖的package包/类
@Override
public ItemType getItemType() {
	return AnyItemType.getInstance(); 
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:5,代码来源:JPConverterImpl.java


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