Java Doc for Value.java in  » XML » saxonb » net » sf » saxon » value » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » saxonb » net.sf.saxon.value 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.saxon.value.Value

All known Subclasses:   net.sf.saxon.value.Closure,  net.sf.saxon.value.SingletonNode,  net.sf.saxon.value.SequenceExtent,  net.sf.saxon.value.ShareableSequence,  net.sf.saxon.value.AtomicValue,  net.sf.saxon.value.IntegerRange,  net.sf.saxon.value.EmptySequence,
Value
abstract public class Value implements Expression,Serializable,ValueRepresentation(Code)
A value is the result of an expression but it is also an expression in its own right. Note that every value can be regarded as a sequence - in many cases, a sequence of length one.


Field Summary
final public static  Class[]EMPTY_CLASS_ARRAY
    


Method Summary
public static  ItemasItem(ValueRepresentation value, XPathContext context)
     Static method to make an Item from a Value
Parameters:
  value - the value to be converted
Parameters:
  context - the context.
public static  SequenceIteratorasIterator(ValueRepresentation val, XPathContext context)
     Static method to get an Iterator over any ValueRepresentation (which may be either a Value or a NodeInfo
Parameters:
  val - The supplied value, or null, indicating the empty sequence.
Parameters:
  context - The evaluation context.
public static  ValueasValue(ValueRepresentation val)
     Static method to make a Value from a given Item (which may be either an AtomicValue or a NodeInfo
Parameters:
  val - The supplied value, or null, indicating the empty sequence.
public  voidcheckPermittedContents(SchemaType parentType, StaticContext env, boolean whole)
     Check statically that the results of the expression are capable of constructing the content of a given schema type.
public static  CharSequencecollapseWhitespace(CharSequence in)
    
public static  Objectconvert(Item item)
     Internal method to convert an XPath value to a Java object. An atomic value is returned as an instance of the best available Java class.
public static  ValueconvertJavaObjectToXPath(Object object, SequenceType requiredType, Configuration config)
     Convert a Java object to an XPath value.
public  ObjectconvertToJava(Class target, XPathContext context)
    
public  voiddisplay(int level, NamePool pool, PrintStream out)
    
public  booleaneffectiveBooleanValue(XPathContext context)
     Get the effective boolean value of the expression.
public  booleanequals(Object obj)
     Compare two (sequence) values for equality.
public  StringevaluateAsString(XPathContext context)
     Evaluate an expression as a String.
public  ItemevaluateItem(XPathContext context)
     Evaluate as a singleton item (or empty sequence).
public  intgetCardinality()
    
final public  intgetDependencies()
     Determine which aspects of the context the expression depends on.
public  ItemTypegetItemType(TypeHierarchy th)
     Determine the data type of the items in the expression, if possible for the default implementation: AnyItemType (not known)
Parameters:
  th - The TypeHierarchy.
public static  SequenceIteratorgetIterator(ValueRepresentation val)
    
public  intgetLength()
    
final public  ContainergetParentExpression()
     Get the expression that immediately contains this expression.
public  intgetSpecialProperties()
     Get the static properties of this expression (other than its type).
public  StringgetStringValue()
     Convert the value to a string, using the serialization rules.
public  inthashCode()
    
public  ItemitemAt(int n)
     Get the n'th item in the sequence (starting from 0).
final public  IteratoriterateSubExpressions()
     Get the sub-expressions of this expression.
public static  QNameValuemakeQNameValue(Object object, Configuration config)
    
public static  CharSequencenormalizeWhitespace(CharSequence in)
    
final public  Expressionoptimize(Optimizer opt, StaticContext env, ItemType contextItemType)
    
public  voidprocess(XPathContext context)
    
final public  Expressionpromote(PromotionOffer offer)
     Offer promotion for this subexpression.
public  Valuereduce()
     Reduce a value to its simplest form.
public  booleanschemaEquals(Value obj)
     Compare two (sequence) values for equality.
final public  Expressionsimplify(StaticContext env)
    
public static  doublestringToNumber(CharSequence s)
     Static method to convert strings to numbers.
public  StringtoString()
    
public static  CharSequencetrimWhitespace(CharSequence in)
     Remove leading and trailing whitespace.
final public  ExpressiontypeCheck(StaticContext env, ItemType contextItemType)
    

Field Detail
EMPTY_CLASS_ARRAY
final public static Class[] EMPTY_CLASS_ARRAY(Code)





Method Detail
asItem
public static Item asItem(ValueRepresentation value, XPathContext context) throws XPathException(Code)
Static method to make an Item from a Value
Parameters:
  value - the value to be converted
Parameters:
  context - the context. It is probably safe to set this to null. null if the value is an empty sequence; or the only item in the valueif it is a singleton sequence
throws:
  XPathException - if the Value contains multiple items



asIterator
public static SequenceIterator asIterator(ValueRepresentation val, XPathContext context) throws XPathException(Code)
Static method to get an Iterator over any ValueRepresentation (which may be either a Value or a NodeInfo
Parameters:
  val - The supplied value, or null, indicating the empty sequence.
Parameters:
  context - The evaluation context. This may be null. It should always be possible toiterate over a value without supplying a context, but sometimes the contextcan provide access to better error information The supplied value, if it is a value, or a SingletonNode thatwraps the item, if it is a node. If the supplied value was null,return an EmptySequence



asValue
public static Value asValue(ValueRepresentation val)(Code)
Static method to make a Value from a given Item (which may be either an AtomicValue or a NodeInfo
Parameters:
  val - The supplied value, or null, indicating the empty sequence. The supplied value, if it is a value, or a SingletonNode thatwraps the item, if it is a node. If the supplied value was null,return an EmptySequence



checkPermittedContents
public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code)
Check statically that the results of the expression are capable of constructing the content of a given schema type.
Parameters:
  parentType - The schema type
Parameters:
  env - the static context
Parameters:
  whole -
throws:
  XPathException - if the expression doesn't match the required content type



collapseWhitespace
public static CharSequence collapseWhitespace(CharSequence in)(Code)
Collapse whitespace as defined in XML Schema



convert
public static Object convert(Item item) throws XPathException(Code)
Internal method to convert an XPath value to a Java object. An atomic value is returned as an instance of the best available Java class. If the item is a node, the node is "unwrapped", to return the underlying node in the original model (which might be, for example, a DOM or JDOM node).



convertJavaObjectToXPath
public static Value convertJavaObjectToXPath(Object object, SequenceType requiredType, Configuration config) throws XPathException(Code)
Convert a Java object to an XPath value. This method is called to handle the result of an external function call (but only if the required type is not known), and also to process global parameters passed to the stylesheet or query.
Parameters:
  object - The Java object to be converted
Parameters:
  requiredType - The required type of the result (if known)
Parameters:
  config - The Configuration: may be null, in which case certain kinds of object(eg. DOM nodes) cannot be handled the result of converting the value. If the value is null, returns null.



convertToJava
public Object convertToJava(Class target, XPathContext context) throws XPathException(Code)
Convert to Java object (for passing to external functions)



display
public void display(int level, NamePool pool, PrintStream out)(Code)
Diagnostic display of the expression



effectiveBooleanValue
public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)
Get the effective boolean value of the expression. This returns false if the value is the empty sequence, a zero-length string, a number equal to zero, or the boolean false. Otherwise it returns true.
Parameters:
  context - The context in which the expression is to be evaluated
exception:
  XPathException - if any dynamic error occurs evaluating theexpression the effective boolean value



equals
public boolean equals(Object obj)(Code)
Compare two (sequence) values for equality. This supports identity constraints in XML Schema, which allow list-valued elements and attributes to participate in key and uniqueness constraints. This method returns false if any error occurs during the comparison, or if any of the items in either sequence is a node rather than an atomic value.



evaluateAsString
public String evaluateAsString(XPathContext context) throws XPathException(Code)
Evaluate an expression as a String. This function must only be called in contexts where it is known that the expression will return a single string (or where an empty sequence is to be treated as a zero-length string). Implementations should not attempt to convert the result to a string, other than converting () to "". This method is used mainly to evaluate expressions produced by compiling an attribute value template.
exception:
  XPathException - if any dynamic error occurs evaluating theexpression
exception:
  ClassCastException - if the result type of theexpression is not xs:string?
Parameters:
  context - The context in which the expression is to be evaluated the value of the expression, evaluated in the current context.The expression must return a string or (); if the value of theexpression is (), this method returns "".



evaluateItem
public Item evaluateItem(XPathContext context) throws XPathException(Code)
Evaluate as a singleton item (or empty sequence). Note: this implementation returns the first item in the sequence. The method should not be used unless appropriate type-checking has been done to ensure that the value will be a singleton.



getCardinality
public int getCardinality()(Code)
Determine the cardinality



getDependencies
final public int getDependencies()(Code)
Determine which aspects of the context the expression depends on. The result is a bitwise-or'ed value composed from constants such as StaticProperty.VARIABLES and StaticProperty.CURRENT_NODE for a Value, this always returns zero.



getItemType
public ItemType getItemType(TypeHierarchy th)(Code)
Determine the data type of the items in the expression, if possible for the default implementation: AnyItemType (not known)
Parameters:
  th - The TypeHierarchy. Can be null if the target is an AtomicValue.



getIterator
public static SequenceIterator getIterator(ValueRepresentation val) throws XPathException(Code)
Get a SequenceIterator over a ValueRepresentation



getLength
public int getLength() throws XPathException(Code)
Get the length of the sequence



getParentExpression
final public Container getParentExpression()(Code)
Get the expression that immediately contains this expression. This method returns null for an outermost expression; it also return null in the case of literal values. For an XPath expression occurring within an XSLT stylesheet, this method returns the XSLT instruction containing the XPath expression. the expression that contains this expression, if known; return nullif there is no containing expression or if the containing expression is unknown.



getSpecialProperties
public int getSpecialProperties()(Code)
Get the static properties of this expression (other than its type). For a Value, the only special property is StaticProperty.NON_CREATIVE . StaticProperty.NON_CREATIVE



getStringValue
public String getStringValue() throws XPathException(Code)
Convert the value to a string, using the serialization rules. For atomic values this is the same as a cast; for sequence values it gives a space-separated list.
throws:
  XPathException - The method can fail if evaluation of the valuehas been deferred, and if a failure occurs during the deferred evaluation.No failure is possible in the case of an AtomicValue.



hashCode
public int hashCode()(Code)
Return a hash code to support the equals() function



itemAt
public Item itemAt(int n) throws XPathException(Code)
Get the n'th item in the sequence (starting from 0). This is defined for all Values, but its real benefits come for a sequence Value stored extensionally (or for a MemoClosure, once all the values have been read)



iterateSubExpressions
final public Iterator iterateSubExpressions()(Code)
Get the sub-expressions of this expression. for a Value, this always returns an empty array



makeQNameValue
public static QNameValue makeQNameValue(Object object, Configuration config)(Code)
Temporary method to make a QNameValue from a JAXP 1.3 QName, without creating a compile-time link to the JDK 1.5 QName class
Parameters:
  object - an instance of javax.xml.namespace.QName a corresponding Saxon QNameValue, or null if any error occurs performing the conversion



normalizeWhitespace
public static CharSequence normalizeWhitespace(CharSequence in)(Code)
Normalize whitespace as defined in XML Schema



optimize
final public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)(Code)
Optimize an expression for a Value, this always returns the value unchanged



process
public void process(XPathContext context) throws XPathException(Code)
Process the value as an instruction, without returning any tail calls
Parameters:
  context - The dynamic context, giving access to the current node,the current variables, etc.



promote
final public Expression promote(PromotionOffer offer)(Code)
Offer promotion for this subexpression. Values (constant expressions) are never promoted
Parameters:
  offer - details of the offer, for example the offer to moveexpressions that don't depend on the context to an outer level inthe containing expression For a Value, this always returns the value unchanged



reduce
public Value reduce() throws XPathException(Code)
Reduce a value to its simplest form. If the value is a closure or some other form of deferred value such as a FunctionCallPackage, then it is reduced to a SequenceExtent. If it is a SequenceExtent containing a single item, then it is reduced to that item. One consequence that is exploited by class FilterExpression is that if the value is a singleton numeric value, then the result will be an instance of NumericValue



schemaEquals
public boolean schemaEquals(Value obj)(Code)
Compare two (sequence) values for equality. This supports identity constraints in XML Schema, which allow list-valued elements and attributes to participate in key and uniqueness constraints. This method returns false if any error occurs during the comparison, or if any of the items in either sequence is a node rather than an atomic value.



simplify
final public Expression simplify(StaticContext env)(Code)
Simplify an expression for a Value, this always returns the value unchanged



stringToNumber
public static double stringToNumber(CharSequence s) throws NumberFormatException(Code)
Static method to convert strings to numbers. Might as well go here as anywhere else.
Parameters:
  s - the String to be converted a double representing the value of the String
throws:
  NumberFormatException - if the value cannot be converted



toString
public String toString()(Code)
Convert to a string for diagnostic output



trimWhitespace
public static CharSequence trimWhitespace(CharSequence in)(Code)
Remove leading and trailing whitespace. This has the same effect as collapseWhitespace, but is cheaper, for use by data types that do not allow internal whitespace.
Parameters:
  in - the input string whose whitespace is to be removed the result of removing excess whitespace



typeCheck
final public Expression typeCheck(StaticContext env, ItemType contextItemType)(Code)
TypeCheck an expression for a Value, this always returns the value unchanged



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.