org.apache.xpath.objects.XObject.allowDetachToRelease()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.apache.xpath.objects.XObject.allowDetachToRelease()方法的一些代码示例,展示了XObject.allowDetachToRelease()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XObject.allowDetachToRelease()方法的具体详情如下:
包路径:org.apache.xpath.objects.XObject
类名称:XObject
方法名:allowDetachToRelease

XObject.allowDetachToRelease介绍

[英]Specify if it's OK for detach to release the iterator for reuse. This function should be called with a value of false for objects that are stored in variables. Calling this with a value of false on a XNodeSet will cause the nodeset to be cached.
[中]指定detach是否可以释放迭代器以供重用。对于存储在变量中的对象,应使用false值调用此函数。在XNodeSet上使用false值调用此函数将导致缓存nodeset。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Have the object release it's resources.
 * Call only when the variable or argument is going out of scope.
 */
public void detach()
{
 if(null != m_val)
 {
  m_val.allowDetachToRelease(true);
  m_val.detach();
 }
}

代码示例来源:origin: xalan/xalan

/**
 * Have the object release it's resources.
 * Call only when the variable or argument is going out of scope.
 */
public void detach()
{
 if(null != m_val)
 {
  m_val.allowDetachToRelease(true);
  m_val.detach();
 }
}

代码示例来源:origin: robovm/robovm

/**
 * Forces the object to release it's resources.  This is more harsh than
 * detach().
 */
public void destruct()
{
 if (null != m_obj)
 {
  allowDetachToRelease(true);
  detach();
  setObject(null);
 }
}

代码示例来源:origin: xalan/xalan

/**
 * Forces the object to release it's resources.  This is more harsh than
 * detach().
 */
public void destruct()
{
 if (null != m_obj)
 {
  allowDetachToRelease(true);
  detach();
  setObject(null);
 }
}

代码示例来源:origin: robovm/robovm

/**
 * Calling this with a value of false will cause the nodeset 
 * to be cached.
 * @see DTMIterator#allowDetachToRelease(boolean)
 */
public void allowDetachToRelease(boolean allowRelease)
{
  if((false == allowRelease) && !hasCache())
  {
    setShouldCacheNodes(true);
  }
  
  if(null != m_iter)
    m_iter.allowDetachToRelease(allowRelease);
  super.allowDetachToRelease(allowRelease);
}

代码示例来源:origin: robovm/robovm

/**
 * For support of literal objects in xpaths.
 *
 * @param xctxt The XPath execution context.
 *
 * @return This object.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
  Expression expr = ((ElemVariable)m_obj).getSelect().getExpression();
 XObject xobj = expr.execute(xctxt);
 xobj.allowDetachToRelease(false);
 return xobj;
}

代码示例来源:origin: xalan/xalan

/**
 * Calling this with a value of false will cause the nodeset 
 * to be cached.
 * @see DTMIterator#allowDetachToRelease(boolean)
 */
public void allowDetachToRelease(boolean allowRelease)
{
  if((false == allowRelease) && !hasCache())
  {
    setShouldCacheNodes(true);
  }
  
  if(null != m_iter)
    m_iter.allowDetachToRelease(allowRelease);
  super.allowDetachToRelease(allowRelease);
}

代码示例来源:origin: xalan/xalan

/**
 * For support of literal objects in xpaths.
 *
 * @param xctxt The XPath execution context.
 *
 * @return This object.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
  Expression expr = ((ElemVariable)m_obj).getSelect().getExpression();
 XObject xobj = expr.execute(xctxt);
 xobj.allowDetachToRelease(false);
 return xobj;
}

代码示例来源:origin: robovm/robovm

/**
 * For support of literal objects in xpaths.
 *
 * @param xctxt The XPath execution context.
 *
 * @return the result of executing the select expression
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
  XObject m_selected;
  m_selected = ((Expression)m_obj).execute(xctxt);
  m_selected.allowDetachToRelease(m_allowRelease);
  if (m_selected.getType() == CLASS_STRING)
   return m_selected;
  else
   return new XString(m_selected.str());
}

代码示例来源:origin: xalan/xalan

/**
 * For support of literal objects in xpaths.
 *
 * @param xctxt The XPath execution context.
 *
 * @return the result of executing the select expression
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
  XObject m_selected;
  m_selected = ((Expression)m_obj).execute(xctxt);
  m_selected.allowDetachToRelease(m_allowRelease);
  if (m_selected.getType() == CLASS_STRING)
   return m_selected;
  else
   return new XString(m_selected.str());
}

代码示例来源:origin: robovm/robovm

xobj.allowDetachToRelease(false); 
argVec.addElement(xobj);

代码示例来源:origin: xalan/xalan

xobj.allowDetachToRelease(false); 
argVec.addElement(xobj);

代码示例来源:origin: robovm/robovm

var.allowDetachToRelease(false);

代码示例来源:origin: robovm/robovm

var.allowDetachToRelease(false);

代码示例来源:origin: xalan/xalan

var.allowDetachToRelease(false);

代码示例来源:origin: xalan/xalan

var.allowDetachToRelease(false);

代码示例来源:origin: MobiVM/robovm

/**
 * Have the object release it's resources.
 * Call only when the variable or argument is going out of scope.
 */
public void detach()
{
 if(null != m_val)
 {
  m_val.allowDetachToRelease(true);
  m_val.detach();
 }
}

代码示例来源:origin: ibinti/bugvm

/**
 * Have the object release it's resources.
 * Call only when the variable or argument is going out of scope.
 */
public void detach()
{
 if(null != m_val)
 {
  m_val.allowDetachToRelease(true);
  m_val.detach();
 }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Have the object release it's resources.
 * Call only when the variable or argument is going out of scope.
 */
public void detach()
{
 if(null != m_val)
 {
  m_val.allowDetachToRelease(true);
  m_val.detach();
 }
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Have the object release it's resources.
 * Call only when the variable or argument is going out of scope.
 */
public void detach()
{
 if(null != m_val)
 {
  m_val.allowDetachToRelease(true);
  m_val.detach();
 }
}

相关文章