Java Doc for AtomicValue.java in  » XML » XPath-Saxon » 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 » XPath Saxon » net.sf.saxon.value 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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

All known Subclasses:   net.sf.saxon.value.DurationValue,  net.sf.saxon.value.ObjectValue,  net.sf.saxon.value.StringValue,  net.sf.saxon.value.BooleanValue,  net.sf.saxon.value.Base64BinaryValue,  net.sf.saxon.value.QNameValue,  net.sf.saxon.value.HexBinaryValue,  net.sf.saxon.value.NumericValue,  net.sf.saxon.value.CalendarValue,
AtomicValue
abstract public class AtomicValue extends Value implements Item(Code)
The AtomicValue class corresponds to the concept of an atomic value in the XPath 2.0 data model. Atomic values belong to one of the 19 primitive types defined in XML Schema; or they are of type xdt:untypedAtomic; or they are "external objects", representing a Saxon extension to the XPath 2.0 type system.

The AtomicValue class contains some methods that are suitable for applications to use, and many others that are designed for internal use by Saxon itself. These have not been fully classified. At present, therefore, none of the methods on this class should be considered to be part of the public Saxon API.


author:
   Michael H. Kay





Method Summary
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.
final public  AtomicValueconvert(int requiredType, XPathContext context)
     Convert the value to a given type.
public  AtomicValueconvert(AtomicType targetType, XPathContext context, boolean validate)
     Convert the value to a given type.
abstract public  AtomicValueconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
     Convert a value to another primitive data type, with control over how validation is handled.
Parameters:
  requiredType - type code of the required atomic type
Parameters:
  validate - true if validation is required.
final public  voiddisplay(int level, NamePool pool, PrintStream out)
    
public  booleaneffectiveBooleanValue(XPathContext context)
    
final public  StringevaluateAsString(XPathContext context)
    
public  ItemevaluateItem(XPathContext context)
    
final public  intgetCardinality()
    
public  AtomicValuegetComponent(int component)
     Method to extract components of a value.
public  intgetImplementationMethod()
     An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
final public  intgetLength()
    
public  AtomicValuegetPrimitiveValue()
     Get the primitive value (the value in the value space).
abstract public  StringgetStringValue()
     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.
public  CharSequencegetStringValueCS()
     Get the value of the item as a CharSequence.
final public  SequenceIteratorgetTypedValue()
    
public  booleanhasBuiltInType()
     Test whether the type of this atomic value is a built-in type.
final public  SequenceIteratoriterate(XPathContext context)
    
public  voidprocess(XPathContext context)
    
public  booleanschemaEquals(Value obj)
     Compare two values for equality.
public  StringtoString()
     Get string value.



Method Detail
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 - true if this atomic value accounts for the entire content of the containing node
throws:
  net.sf.saxon.trans.XPathException - if the expression doesn't match the required content type



convert
final public AtomicValue convert(int requiredType, XPathContext context) throws XPathException(Code)
Convert the value to a given type. The result of the conversion will be an atomic value of the required type. This method works only where the target type is a built-in type.
Parameters:
  requiredType - type code of the required atomic type
Parameters:
  context - the result of the conversion, if conversion was possible. Thiswill always be an instance of the class corresponding to the typeof value requested
throws:
  XPathException - if conversion is not allowed for thisrequired type, or if the particular value cannot be converted



convert
public AtomicValue convert(AtomicType targetType, XPathContext context, boolean validate)(Code)
Convert the value to a given type. The result of the conversion will be an atomic value of the required type. This method works where the target type is a built-in atomic type and also where it is a user-defined atomic type.
Parameters:
  targetType - the type to which the value is to be converted
Parameters:
  context - provides access to conversion context
Parameters:
  validate - true if validation is required, false if the caller already knows that thevalue is valid the value after conversion if successful; or a ValidationErrorValue if conversion failed. Thecaller must check for this condition. Validation may fail even if validation was not requested.



convertPrimitive
abstract public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)(Code)
Convert a value to another primitive data type, with control over how validation is handled.
Parameters:
  requiredType - type code of the required atomic type
Parameters:
  validate - true if validation is required. If set to false, the caller guarantees thatthe value is valid for the target data type, and that further validation is therefore not required.Note that a validation failure may be reported even if validation was not requested.
Parameters:
  context - The conversion context to be used. This is required at present only when converting toa date or time: it provides the implicit timezone. the result of the conversion, if successful. If unsuccessful, the value returnedwill be an ErrorValue. The caller must check for this condition. No exception is thrown, insteadthe exception will be encapsulated within the ErrorValue.



display
final public void display(int level, NamePool pool, PrintStream out)(Code)
Diagnostic print of expression structure
Parameters:
  level - the indentation level of the output
Parameters:
  out -



effectiveBooleanValue
public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)
Get the effective boolean value of the value
Parameters:
  context - the evaluation context (not used in this implementation) true, unless the value is boolean false, numeric zero, orzero-length string



evaluateAsString
final public String evaluateAsString(XPathContext context)(Code)
Evaluate as a string



evaluateItem
public Item evaluateItem(XPathContext context) throws XPathException(Code)
Evaluate the value (this simply returns the value unchanged)
Parameters:
  context - the evaluation context (not used in this implementation) the value, unchanged
throws:
  XPathException -



getCardinality
final public int getCardinality()(Code)
Determine the static cardinality code identifying the cardinality
See Also:   net.sf.saxon.value.Cardinality



getComponent
public AtomicValue getComponent(int component) throws XPathException(Code)
Method to extract components of a value. Implemented by some subclasses, but defined at this level for convenience



getImplementationMethod
public int getImplementationMethod()(Code)
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is prefered.



getLength
final public int getLength()(Code)
Get the length of the sequence always 1 for an atomic value



getPrimitiveValue
public AtomicValue getPrimitiveValue()(Code)
Get the primitive value (the value in the value space). This returns an AtomicValue of a class that would be used to represent the primitive value. In effect this means that for built-in types, it returns the value itself, but for user-defined type, it returns the primitive value minus the type annotation. Note that getItemType() when applied to the result of this function does not not necessarily return a primitive type: for example, this function may return a value of type xdt:dayTimeDuration, which is not a primitive type as defined by net.sf.saxon.type.Type.isPrimitiveType(int)



getStringValue
abstract public String getStringValue()(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. This method is refined for AtomicValues so that it never throws an Exception.



getStringValueCS
public CharSequence getStringValueCS()(Code)
Get the value of the item as a CharSequence. This is in some cases more efficient than the version of the method that returns a String.



getTypedValue
final public SequenceIterator getTypedValue()(Code)
Get the typed value of this item the typed value of the expression (which is this value)



hasBuiltInType
public boolean hasBuiltInType()(Code)
Test whether the type of this atomic value is a built-in type. Default implementation returns true.



iterate
final public SequenceIterator iterate(XPathContext context)(Code)
Iterate over the (single) item in the sequence
Parameters:
  context - the evaluation context (not used in this implementation) a SequenceIterator that iterates over the single item in thisvalue



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



schemaEquals
public boolean schemaEquals(Value obj)(Code)
Compare two 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. The default implementation of schemaEquals() is the same as equals(), but subclasses can override this.



toString
public String toString()(Code)
Get string value. In general toString() for an atomic value displays the value as it would be written in XPath: that is, as a literal if available, or as a call on a constructor function otherwise.



Fields inherited from net.sf.saxon.value.Value
final public static Class[] EMPTY_CLASS_ARRAY(Code)(Java Doc)

Methods inherited from net.sf.saxon.value.Value
public static Item asItem(ValueRepresentation value, XPathContext context) throws XPathException(Code)(Java Doc)
public static SequenceIterator asIterator(ValueRepresentation val, XPathContext context) throws XPathException(Code)(Java Doc)
public static Value asValue(ValueRepresentation val)(Code)(Java Doc)
public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code)(Java Doc)
public static CharSequence collapseWhitespace(CharSequence in)(Code)(Java Doc)
public static Object convert(Item item) throws XPathException(Code)(Java Doc)
public static Value convertJavaObjectToXPath(Object object, SequenceType requiredType, Configuration config) throws XPathException(Code)(Java Doc)
public Object convertToJava(Class target, XPathContext context) throws XPathException(Code)(Java Doc)
public void display(int level, NamePool pool, PrintStream out)(Code)(Java Doc)
public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public String evaluateAsString(XPathContext context) throws XPathException(Code)(Java Doc)
public Item evaluateItem(XPathContext context) throws XPathException(Code)(Java Doc)
public int getCardinality()(Code)(Java Doc)
final public int getDependencies()(Code)(Java Doc)
public ItemType getItemType(TypeHierarchy th)(Code)(Java Doc)
public static SequenceIterator getIterator(ValueRepresentation val) throws XPathException(Code)(Java Doc)
public int getLength() throws XPathException(Code)(Java Doc)
final public Container getParentExpression()(Code)(Java Doc)
public int getSpecialProperties()(Code)(Java Doc)
public String getStringValue() throws XPathException(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public Item itemAt(int n) throws XPathException(Code)(Java Doc)
final public Iterator iterateSubExpressions()(Code)(Java Doc)
public static QNameValue makeQNameValue(Object object, Configuration config)(Code)(Java Doc)
public static CharSequence normalizeWhitespace(CharSequence in)(Code)(Java Doc)
final public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)(Code)(Java Doc)
public void process(XPathContext context) throws XPathException(Code)(Java Doc)
final public Expression promote(PromotionOffer offer)(Code)(Java Doc)
public Value reduce() throws XPathException(Code)(Java Doc)
public boolean schemaEquals(Value obj)(Code)(Java Doc)
final public Expression simplify(StaticContext env)(Code)(Java Doc)
public static double stringToNumber(CharSequence s) throws NumberFormatException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public static CharSequence trimWhitespace(CharSequence in)(Code)(Java Doc)
final public Expression typeCheck(StaticContext env, ItemType contextItemType)(Code)(Java Doc)

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.