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


Java XBoolean.S_TRUE属性代码示例

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


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

示例1: execute

/**
 * AND two expressions and return the boolean result. Override
 * superclass method for optimization purposes.
 *
 * @param xctxt The runtime execution context.
 *
 * @return {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_TRUE} or
 * {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_FALSE}.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  XObject expr1 = m_left.execute(xctxt);

  if (expr1.bool())
  {
    XObject expr2 = m_right.execute(xctxt);

    return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
  }
  else
    return XBoolean.S_FALSE;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:And.java

示例2: execute

/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  String s1 = m_arg0.execute(xctxt).str();
  String s2 = m_arg1.execute(xctxt).str();

  // Add this check for JDK consistency for empty strings.
  if (s1.length() == 0 && s2.length() == 0)
    return XBoolean.S_TRUE;

  int index = s1.indexOf(s2);

  return (index > -1) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:FuncContains.java

示例3: execute

/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  String lang = m_arg0.execute(xctxt).str();
  int parent = xctxt.getCurrentNode();
  boolean isLang = false;
  DTM dtm = xctxt.getDTM(parent);

  while (DTM.NULL != parent)
  {
    if (DTM.ELEMENT_NODE == dtm.getNodeType(parent))
    {
      int langAttr = dtm.getAttributeNode(parent, "http://www.w3.org/XML/1998/namespace", "lang");

      if (DTM.NULL != langAttr)
      {
        String langVal = dtm.getNodeValue(langAttr);
        // %OPT%
        if (langVal.toLowerCase().startsWith(lang.toLowerCase()))
        {
          int valLen = lang.length();

          if ((langVal.length() == valLen)
                  || (langVal.charAt(valLen) == '-'))
          {
            isLang = true;
          }
        }

        break;
      }
    }

    parent = dtm.getParent(parent);
  }

  return isLang ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:FuncLang.java

示例4: execute

/**
 * OR two expressions and return the boolean result. Override
 * superclass method for optimization purposes.
 *
 * @param xctxt The runtime execution context.
 *
 * @return {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_TRUE} or
 * {@link com.sun.org.apache.xpath.internal.objects.XBoolean#S_FALSE}.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  XObject expr1 = m_left.execute(xctxt);

  if (!expr1.bool())
  {
    XObject expr2 = m_right.execute(xctxt);

    return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
  }
  else
    return XBoolean.S_TRUE;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:25,代码来源:Or.java

示例5: execute

/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  String prefix;
  String namespace;
  String methName;

  String fullName = m_arg0.execute(xctxt).str();
  int indexOfNSSep = fullName.indexOf(':');

  if (indexOfNSSep < 0)
  {
    prefix = "";
    namespace = Constants.S_XSLNAMESPACEURL;
    methName = fullName;
  }
  else
  {
    prefix = fullName.substring(0, indexOfNSSep);
    namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix);
    if (null == namespace)
      return XBoolean.S_FALSE;
    methName= fullName.substring(indexOfNSSep + 1);
  }

  if (namespace.equals(Constants.S_XSLNAMESPACEURL)
  ||  namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL)) {

      // J2SE does not support Xalan interpretive
      /*
    try {
      TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject();
      return transformer.getStylesheet().getAvailableElements().containsKey(
                                                          new QName(namespace, methName))
             ? XBoolean.S_TRUE : XBoolean.S_FALSE;
    } catch (Exception e) {
      return XBoolean.S_FALSE;
    }
    */
      return XBoolean.S_FALSE;
  } else {
    //dml
    ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject();
    return extProvider.elementAvailable(namespace, methName)
           ? XBoolean.S_TRUE : XBoolean.S_FALSE;
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:55,代码来源:FuncExtElementAvailable.java

示例6: operate

/**
 * Apply the operation to two operands, and return the result.
 *
 *
 * @param left non-null reference to the evaluated left operand.
 * @param right non-null reference to the evaluated right operand.
 *
 * @return non-null reference to the XObject that represents the result of the operation.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject operate(XObject left, XObject right)
        throws javax.xml.transform.TransformerException
{
  return left.greaterThanOrEqual(right)
         ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:17,代码来源:Gte.java

示例7: operate

/**
 * Apply the operation to two operands, and return the result.
 *
 *
 * @param right non-null reference to the evaluated right operand.
 *
 * @return non-null reference to the XObject that represents the result of the operation.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject operate(XObject right) throws javax.xml.transform.TransformerException
{

  if (XObject.CLASS_BOOLEAN == right.getType())
    return right;
  else
    return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:infobip,项目名称:infobip-open-jdk-8,代码行数:18,代码来源:Bool.java

示例8: execute

/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
  return m_arg0.execute(xctxt).xstr().startsWith(m_arg1.execute(xctxt).xstr())
         ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:FuncStartsWith.java

示例9: execute

/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
  return XBoolean.S_TRUE;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:FuncTrue.java

示例10: operate

/**
 * Apply the operation to two operands, and return the result.
 *
 *
 * @param left non-null reference to the evaluated left operand.
 * @param right non-null reference to the evaluated right operand.
 *
 * @return non-null reference to the XObject that represents the result of the operation.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject operate(XObject left, XObject right)
        throws javax.xml.transform.TransformerException
{
  return (left.notEquals(right)) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:NotEquals.java

示例11: operate

/**
 * Apply the operation to two operands, and return the result.
 *
 *
 * @param left non-null reference to the evaluated left operand.
 * @param right non-null reference to the evaluated right operand.
 *
 * @return non-null reference to the XObject that represents the result of the operation.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject operate(XObject left, XObject right)
        throws javax.xml.transform.TransformerException
{
  return left.greaterThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:Gt.java

示例12: execute

/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
  return m_arg0.execute(xctxt).bool() ? XBoolean.S_FALSE : XBoolean.S_TRUE;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:FuncNot.java

示例13: operate

/**
 * Apply the operation to two operands, and return the result.
 *
 *
 * @param left non-null reference to the evaluated left operand.
 * @param right non-null reference to the evaluated right operand.
 *
 * @return non-null reference to the XObject that represents the result of the operation.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject operate(XObject left, XObject right)
        throws javax.xml.transform.TransformerException
{
  return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:Equals.java

示例14: operate

/**
 * Apply the operation to two operands, and return the result.
 *
 *
 * @param left non-null reference to the evaluated left operand.
 * @param right non-null reference to the evaluated right operand.
 *
 * @return non-null reference to the XObject that represents the result of the operation.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject operate(XObject left, XObject right)
        throws javax.xml.transform.TransformerException
{
  return left.lessThanOrEqual(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:Lte.java

示例15: execute

/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
  return m_arg0.execute(xctxt).bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:FuncBoolean.java


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