本文整理了Java中com.sun.org.apache.xpath.internal.objects.XObject.getType()
方法的一些代码示例,展示了XObject.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XObject.getType()
方法的具体详情如下:
包路径:com.sun.org.apache.xpath.internal.objects.XObject
类名称:XObject
方法名:getType
[英]Tell what kind of class this is.
[中]告诉我这是什么课。
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* Tell if two objects are functionally equal.
*
* @param obj2 Object to compare this to
*
* @return True if the given object is of type CLASS_NULL
*/
public boolean equals(XObject obj2)
{
return obj2.getType() == CLASS_NULL;
}
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* Tell if two objects are functionally equal.
*
* @param obj2 Object to compare this to
*
* @return True if the given object is of type CLASS_NULL
*/
public boolean equals(XObject obj2)
{
return obj2.getType() == CLASS_NULL;
}
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* 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;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* 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;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* Get a global variable or parameter from the global stack frame.
*
*
* @param xctxt The XPath context, which must be passed in order to
* lazy evaluate variables.
*
* @param index Global variable index relative to the global stack
* frame bottom.
*
* @return The value of the variable.
*
* @throws TransformerException
*/
public XObject getGlobalVariable(XPathContext xctxt, final int index)
throws TransformerException
{
XObject val = _stackFrames[index];
// Lazy execution of variables.
if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
return (_stackFrames[index] = val.execute(xctxt));
return val;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* 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_NUMBER == right.getType())
return right;
else
return new XNumber(right.num());
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* 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_NUMBER == right.getType())
return right;
else
return new XNumber(right.num());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* Tell if two objects are functionally not equal.
*
* @param obj2 Object to compare this to
*
* @return True if this object is not equal to the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean notEquals(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.notEquals(this);
return !equals(obj2);
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* Tell if two objects are functionally not equal.
*
* @param obj2 Object to compare this to
*
* @return True if this object is not equal to the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean notEquals(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.notEquals(this);
return !equals(obj2);
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* Get a global variable or parameter from the global stack frame.
*
*
* @param xctxt The XPath context, which must be passed in order to
* lazy evaluate variables.
*
* @param index Global variable index relative to the global stack
* frame bottom.
*
* @return The value of the variable.
*
* @throws TransformerException
*/
public XObject getGlobalVariable(XPathContext xctxt, final int index, boolean destructiveOK)
throws TransformerException
{
XObject val = _stackFrames[index];
// Lazy execution of variables.
if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE)
return (_stackFrames[index] = val.execute(xctxt));
return destructiveOK ? val : val.getFresh();
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* Tell if one object is less than the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is less than the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean lessThan(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.greaterThan(this);
return this.num() < obj2.num();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* Tell if one object is less than the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is less than the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean lessThan(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.greaterThan(this);
return this.num() < obj2.num();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* Tell if one object is less than or equal to the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is less than or equal to the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean lessThanOrEqual(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.greaterThanOrEqual(this);
return this.num() <= obj2.num();
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* Tell if one object is less than or equal to the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is less than or equal to the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean lessThanOrEqual(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.greaterThanOrEqual(this);
return this.num() <= obj2.num();
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* Tell if one object is greater than the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is greater than the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean greaterThan(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.lessThan(this);
return this.num() > obj2.num();
}
代码示例来源:origin: com.sun.xml.parsers/jaxp-ri
/**
* Tell if one object is greater than or equal to the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is greater than or equal to the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean greaterThanOrEqual(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.lessThanOrEqual(this);
return this.num() >= obj2.num();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* Tell if one object is greater than the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is greater than the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean greaterThan(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.lessThan(this);
return this.num() > obj2.num();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* Tell if one object is greater than or equal to the other.
*
* @param obj2 Object to compare this to
*
* @return True if this object is greater than or equal to the given object
*
* @throws javax.xml.transform.TransformerException
*/
public boolean greaterThanOrEqual(XObject obj2)
throws javax.xml.transform.TransformerException
{
// In order to handle the 'all' semantics of
// nodeset comparisons, we always call the
// nodeset function. Because the arguments
// are backwards, we call the opposite comparison
// function.
if (obj2.getType() == XObject.CLASS_NODESET)
return obj2.lessThanOrEqual(this);
return this.num() >= obj2.num();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri
/**
* 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: com.sun.xml.parsers/jaxp-ri
/**
* 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());
}
内容来源于网络,如有侵权,请联系作者删除!