@@ -890,7 +890,20 @@ public void serialize(final ByteBuffer buf) throws IOException {
890890 * @return the StringValue.
891891 */
892892 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 );
894907 }
895908
896909 /**
@@ -903,12 +916,26 @@ public static StringValue deserialize(@Nullable final Expression expression, fin
903916 * @return the StringValue.
904917 */
905918 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 {
906933 final VariableByteBufferInput vbbi = new VariableByteBufferInput (buf );
907934 final int type = vbbi .read ();
908935 if (checkType != null && type != checkType .intValue ()) {
909936 throw new XPathException (expression , "Expected deserialized StringValue of type: " + Type .getTypeName (checkType ) + ", but found: " + Type .getTypeName (type ));
910937 }
911938 final String value = vbbi .readUTF ();
912- return new StringValue (expression , value , type );
939+ return new StringValue (expression , value , type , expand );
913940 }
914941}
0 commit comments