Java Doc for Accessor.java in  » JMX » je » com » sleepycat » persist » impl » 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 » JMX » je » com.sleepycat.persist.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sleepycat.persist.impl.Accessor

All known Subclasses:   com.sleepycat.persist.impl.RawAccessor,  com.sleepycat.persist.impl.EnhancedAccessor,  com.sleepycat.persist.impl.ReflectionAccessor,
Accessor
interface Accessor (Code)
Field binding operations implemented via reflection (ReflectionAccessor) or bytecode enhancement (EnhancedAccessor).

Normally we read the set of all secondary key fields first and then the set of all non-key fields, reading each set in order of field name. But when reading an old format record we must account for the following class evolution conversions:

  • Convert a field: pass value thru converter
  • Widen a field type: pass value thru widener
  • Add a field: don't read the new field
  • Delete a field: skip the deleted field
  • Rename a field: read field in a different order

To support these operations, the methods for reading fields allow reading specific ranges of fields as well as all fields. For example, all fields up to a deleted field could be read, and then all fields from the following field onward.


author:
   Mark Hayes


Field Summary
final  intMAX_FIELD_NUM
     A large field value to use instead of Integer.MAX_VALUE, to work around Java JIT compiler bug when doing an (X <= Integer.MAX_VALUE) as would be done in readXxxKeyFields methods.


Method Summary
 ObjectgetField(Object o, int field, int superLevel, boolean isSecField)
     Returns the value of a given field, representing primitives as primitive wrapper objects.
Parameters:
  o - is the object containing the key field.
Parameters:
  field - is the field index.
Parameters:
  superLevel - is a positive number to identify the field of theclass that is the Nth super instance; or zero to identify the field inthis class.
Parameters:
  isSecField - is true for a secondary key field or false for anon-key field.
 booleanisPriKeyFieldNullOrZero(Object o)
     Returns whether the primary key field is null (for a reference type) or zero (for a primitive integer type).
 ObjectnewArray(int len)
     Creates a new one dimensional array of the given length, having the target class as its component type.

Using a special method for a one dimensional array, which can be implemented by bytecode generation, is a compromise.

 ObjectnewInstance()
     Creates a new instance of the target class using its default constructor.
 voidreadNonKeyFields(Object o, EntityInput input, int startField, int endField, int superLevel)
     Reads a range of non-key field values from the given EntityInput, reading fields in super classes first and in name order within class.

To read all fields, pass -1 for superLevel, zero for startField and MAX_FIELD_NUM for endField.

 voidreadPriKeyField(Object o, EntityInput input)
     Reads the primary key field value from the given EntityInput.
 voidreadSecKeyFields(Object o, EntityInput input, int startField, int endField, int superLevel)
     Reads a range of secondary key field values from the given EntityInput, reading fields in super classes first and in name order within class.

If the primary key has a reference type, this method must call EntityInput.registerPriKeyObject before reading any other fields.

To read all fields, pass -1 for superLevel, zero for startField and MAX_FIELD_NUM for endField.

 voidsetField(Object o, int field, int superLevel, boolean isSecField, Object value)
     Changes the value of a given field, representing primitives as primitive wrapper objects.
 voidwriteNonKeyFields(Object o, EntityOutput output)
     Writes all non-key field values to the given EntityOutput, writing fields in super classes first and in name order within class.
 voidwritePriKeyField(Object o, EntityOutput output)
     Writes the primary key field value to the given EntityOutput.
 voidwriteSecKeyFields(Object o, EntityOutput output)
     Writes all secondary key field values to the given EntityOutput, writing fields in super classes first and in name order within class.

Field Detail
MAX_FIELD_NUM
final int MAX_FIELD_NUM(Code)
A large field value to use instead of Integer.MAX_VALUE, to work around Java JIT compiler bug when doing an (X <= Integer.MAX_VALUE) as would be done in readXxxKeyFields methods.





Method Detail
getField
Object getField(Object o, int field, int superLevel, boolean isSecField)(Code)
Returns the value of a given field, representing primitives as primitive wrapper objects.
Parameters:
  o - is the object containing the key field.
Parameters:
  field - is the field index.
Parameters:
  superLevel - is a positive number to identify the field of theclass that is the Nth super instance; or zero to identify the field inthis class.
Parameters:
  isSecField - is true for a secondary key field or false for anon-key field. the current field value, or null for a reference type fieldthat is null.



isPriKeyFieldNullOrZero
boolean isPriKeyFieldNullOrZero(Object o)(Code)
Returns whether the primary key field is null (for a reference type) or zero (for a primitive integer type). Null and zero are used as an indication that the key should be assigned from a sequence.



newArray
Object newArray(int len)(Code)
Creates a new one dimensional array of the given length, having the target class as its component type.

Using a special method for a one dimensional array, which can be implemented by bytecode generation, is a compromise. We use reflection to create multidimensional arrays. We could in the future generate code to create arrays as they are encountered, if there is a need to avoid reflection for multidimensional arrays.




newInstance
Object newInstance()(Code)
Creates a new instance of the target class using its default constructor.



readNonKeyFields
void readNonKeyFields(Object o, EntityInput input, int startField, int endField, int superLevel)(Code)
Reads a range of non-key field values from the given EntityInput, reading fields in super classes first and in name order within class.

To read all fields, pass -1 for superLevel, zero for startField and MAX_FIELD_NUM for endField. Fields from super classes are read first.

To read a specific range of fields, pass a non-negative number for superLevel and the specific indices of the field range to be read in the class at that level.


Parameters:
  o - is the object whose non-key fields are to be read.
Parameters:
  input - the input data to read from.
Parameters:
  startField - the starting field index in the range of fields toread. To read all fields, the startField should be zero.
Parameters:
  endField - the ending field index in the range of fields to read.To read all fields, the endField should be MAX_FIELD_NUM.
Parameters:
  superLevel - is a non-negative number to read the fields of theclass that is the Nth super instance; or a negative number to readfields in all classes.



readPriKeyField
void readPriKeyField(Object o, EntityInput input)(Code)
Reads the primary key field value from the given EntityInput.

To read a primary key with a reference type, this method must call EntityInput.readKeyObject.


Parameters:
  o - is the object whose primary key field is to be read.
Parameters:
  input - the input data to read from.



readSecKeyFields
void readSecKeyFields(Object o, EntityInput input, int startField, int endField, int superLevel)(Code)
Reads a range of secondary key field values from the given EntityInput, reading fields in super classes first and in name order within class.

If the primary key has a reference type, this method must call EntityInput.registerPriKeyObject before reading any other fields.

To read all fields, pass -1 for superLevel, zero for startField and MAX_FIELD_NUM for endField. Fields from super classes are read first.

To read a specific range of fields, pass a non-negative number for superLevel and the specific indices of the field range to be read in the class at that level.


Parameters:
  o - is the object whose secondary key fields are to be read.
Parameters:
  input - the input data to read from.
Parameters:
  startField - the starting field index in the range of fields toread. To read all fields, the startField should be zero.
Parameters:
  endField - the ending field index in the range of fields to read.To read all fields, the endField should be MAX_FIELD_NUM.
Parameters:
  superLevel - is a non-negative number to read the fields of theclass that is the Nth super instance; or a negative number to readfields in all classes.



setField
void setField(Object o, int field, int superLevel, boolean isSecField, Object value)(Code)
Changes the value of a given field, representing primitives as primitive wrapper objects.
Parameters:
  o - is the object containing the key field.
Parameters:
  field - is the field index.
Parameters:
  superLevel - is a positive number to identify the field of theclass that is the Nth super instance; or zero to identify the field inthis class.
Parameters:
  isSecField - is true for a secondary key field or false for anon-key field.
Parameters:
  value - is the new value of the field, or null to set a referencetype field to null.



writeNonKeyFields
void writeNonKeyFields(Object o, EntityOutput output)(Code)
Writes all non-key field values to the given EntityOutput, writing fields in super classes first and in name order within class.
Parameters:
  o - is the object whose non-key fields are to be written.
Parameters:
  output - the output data to write to.



writePriKeyField
void writePriKeyField(Object o, EntityOutput output)(Code)
Writes the primary key field value to the given EntityOutput.

To write a primary key with a reference type, this method must call EntityOutput.writeKeyObject.


Parameters:
  o - is the object whose primary key field is to be written.
Parameters:
  output - the output data to write to.



writeSecKeyFields
void writeSecKeyFields(Object o, EntityOutput output)(Code)
Writes all secondary key field values to the given EntityOutput, writing fields in super classes first and in name order within class.
Parameters:
  o - is the object whose secondary key fields are to be written.

If the primary key has a reference type, this method must callEntityOutput.registerPriKeyObject before writing any other fields.


Parameters:
  output - the output data to write to.



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