Skip to content

Commit 0ffc7b0

Browse files
committed
JAVA-901: cleanup org.bson.Lazy*
1 parent d10c777 commit 0ffc7b0

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

src/main/org/bson/KeyCachingLazyBSONObject.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
/**
2323
* @author brendan
2424
* @author scotthernandez
25+
*
26+
* @deprecated This class is NOT a part of public API and will be dropped in 3.x versions.
2527
*/
28+
@Deprecated
2629
public class KeyCachingLazyBSONObject extends LazyBSONObject {
2730

2831
public KeyCachingLazyBSONObject(byte[] data , LazyBSONCallback cbk) { super( data , cbk ); }

src/main/org/bson/LazyBSONCallback.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public void gotBinary( String name, byte type, byte[] data ){
5454
setRootObject( createObject( data, 0 ) );
5555
}
5656

57+
/**
58+
* @deprecated This method is NOT a part of public API and will be dropped in 3.x versions.
59+
*/
60+
@Deprecated
5761
public void setRootObject( Object root ){
5862
_root = root;
5963
}

src/main/org/bson/LazyBSONObject.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public void remove(){
9191
int offset = _doc_start_offset + FIRST_ELMT_OFFSET;
9292
}
9393

94+
/**
95+
* @deprecated This class is NOT a part of public API and will be dropped in 3.x versions.
96+
*/
97+
@Deprecated
9498
public class LazyBSONKeySet extends ReadOnlySet<String> {
9599

96100
/**
@@ -431,6 +435,10 @@ public Set<Map.Entry<String, Object>> entrySet(){
431435
return new LazyBSONEntrySet();
432436
}
433437

438+
/**
439+
* @deprecated This method is NOT a part of public API and will be dropped in 3.x versions.
440+
*/
441+
@Deprecated
434442
protected boolean isElementEmpty( int offset ){
435443
return getElementType( offset ) == BSON.EOO;
436444
}
@@ -456,10 +464,18 @@ private String getElementFieldName( final int offset ){
456464
return _input.getCString( offset );
457465
}
458466

467+
/**
468+
* @deprecated This method is NOT a part of public API and will be dropped in 3.x versions.
469+
*/
470+
@Deprecated
459471
protected byte getElementType( final int offset ){
460472
return _input.get( offset );
461473
}
462474

475+
/**
476+
* @deprecated This method is NOT a part of public API and will be dropped in 3.x versions.
477+
*/
478+
@Deprecated
463479
protected int getElementBSONSize( int offset ){
464480
int x = 0;
465481
byte type = getElementType( offset++ );
@@ -522,7 +538,10 @@ protected int getElementBSONSize( int offset ){
522538
* Returns the size of the BSON cstring at the given offset in the buffer
523539
* @param offset the offset into the buffer
524540
* @return the size of the BSON cstring, including the null terminator
541+
*
542+
* @deprecated This method is NOT a part of public API and will be dropped in 3.x versions.
525543
*/
544+
@Deprecated
526545
protected int sizeCString( int offset ){
527546
int end = offset;
528547
while ( true ){
@@ -535,6 +554,10 @@ protected int sizeCString( int offset ){
535554
return end - offset + 1;
536555
}
537556

557+
/**
558+
* @deprecated This method is NOT a part of public API and will be dropped in 3.x versions.
559+
*/
560+
@Deprecated
538561
protected Object getElementValue( ElementRecord record ){
539562
switch ( record.type ){
540563
case BSON.EOO:
@@ -645,6 +668,10 @@ private Object readBinary( int valueOffset ){
645668
return bin;
646669
}
647670

671+
protected int getOffset(){
672+
return _doc_start_offset;
673+
}
674+
648675
@Override
649676
public boolean equals(Object o) {
650677
if (this == o) return true;
@@ -677,10 +704,23 @@ public String toString(){
677704
*/
678705
final static int FIRST_ELMT_OFFSET = 4;
679706

707+
/**
708+
* @deprecated Please use {@link #getOffset()} instead.
709+
*/
710+
@Deprecated
680711
protected final int _doc_start_offset;
681712

713+
/**
714+
* @deprecated This field is NOT a part of public API and will be dropped in 3.x versions.
715+
*/
716+
@Deprecated
682717
protected final BSONByteBuffer _input; // TODO - Guard this with synchronicity?
683718
// callback is kept to create sub-objects on the fly
719+
720+
/**
721+
* @deprecated This field is NOT a part of public API and will be dropped in 3.x versions.
722+
*/
723+
@Deprecated
684724
protected final LazyBSONCallback _callback;
685725
private static final Logger log = Logger.getLogger( "org.bson.LazyBSONObject" );
686726
}

0 commit comments

Comments
 (0)