@@ -890,7 +890,20 @@ public void serialize(final ByteBuffer buf) throws IOException {
890
890
* @return the StringValue.
891
891
*/
892
892
public static StringValue deserialize (@ Nullable final Expression expression , final ByteBuffer buf ) throws IOException , XPathException {
893
- return deserialize (expression , buf , null );
893
+ return deserialize (expression , buf , false );
894
+ }
895
+
896
+ /**
897
+ * Deserializes from a ByteBuffer.
898
+ *
899
+ * @param expression the expression that creates the StringValue object.
900
+ * @param buf the ByteBuffer to deserialize from.
901
+ * @param expand if entities need to be expanded
902
+ *
903
+ * @return the StringValue.
904
+ */
905
+ public static StringValue deserialize (@ Nullable final Expression expression , final ByteBuffer buf , final boolean expand ) throws IOException , XPathException {
906
+ return deserialize (expression , buf , null , expand );
894
907
}
895
908
896
909
/**
@@ -903,12 +916,26 @@ public static StringValue deserialize(@Nullable final Expression expression, fin
903
916
* @return the StringValue.
904
917
*/
905
918
public static StringValue deserialize (@ Nullable Expression expression , final ByteBuffer buf , @ Nullable final Integer checkType ) throws IOException , XPathException {
919
+ return deserialize (expression , buf , checkType , false );
920
+ }
921
+
922
+ /**
923
+ * Deserializes from a ByteBuffer.
924
+ *
925
+ * @param expression the expression that creates the StringValue object.
926
+ * @param buf the ByteBuffer to deserialize from.
927
+ * @param checkType an XDM type to check that matches against the deserialized StringValue type.
928
+ * @param expand if entities need to be expanded
929
+ *
930
+ * @return the StringValue.
931
+ */
932
+ public static StringValue deserialize (@ Nullable Expression expression , final ByteBuffer buf , @ Nullable final Integer checkType , final boolean expand ) throws IOException , XPathException {
906
933
final VariableByteBufferInput vbbi = new VariableByteBufferInput (buf );
907
934
final int type = vbbi .read ();
908
935
if (checkType != null && type != checkType .intValue ()) {
909
936
throw new XPathException (expression , "Expected deserialized StringValue of type: " + Type .getTypeName (checkType ) + ", but found: " + Type .getTypeName (type ));
910
937
}
911
938
final String value = vbbi .readUTF ();
912
- return new StringValue (expression , value , type );
939
+ return new StringValue (expression , value , type , expand );
913
940
}
914
941
}
0 commit comments