Skip to content

Commit 02ecf71

Browse files
docs fix
1 parent c57aece commit 02ecf71

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

SerialX-core/src/main/java/org/ugp/serialx/Scope.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public Scope clone()
116116
}
117117

118118
/**
119-
* @param objClass | Class of object to create using protocols.
119+
* @param objClass | Class of object to create using protocols (may or may not support other implementations of {@link Type}).
120120
* @param protocolsToUse | Registry of protocols to use.
121121
*
122122
* @return Object of objClass constructed from this scopes independent values using protocol for objClass or null if there was no protocol found in protocolsToUse!

SerialX-core/src/main/java/org/ugp/serialx/Serializer.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.io.OutputStreamWriter;
2020
import java.io.Reader;
2121
import java.io.StringReader;
22+
import java.io.Writer;
2223
import java.lang.reflect.Type;
2324
import java.net.HttpURLConnection;
2425
import java.net.URL;
@@ -160,7 +161,7 @@ public <T> T toObjectOf(String variableWithscope, Class<T> objClass, T defaultVa
160161
}
161162

162163
/**
163-
* @param type | Class of object to create.
164+
* @param objClass | Class of object to create (may or may not support other implementations of {@link Type}).
164165
*
165166
* @return Object of type constructed from this scopes independent values using protocol for given class or null if there was no protocol found in this {@link Serializer#getProtocols()}!
166167
*
@@ -283,11 +284,25 @@ public void SerializeTo(File f) throws IOException
283284
public void SerializeTo(boolean append, File f, Object... args) throws IOException
284285
{
285286
//double t0 = System.nanoTime();
286-
BufferedWriter writer = new BufferedWriter(new FileWriter(f, append));
287+
Writer writer = new BufferedWriter(new FileWriter(f, append));
287288

288289
writer.write(Stringify(args));
289290

290291
writer.close();
292+
293+
// String serialized = Stringify(args);
294+
//
295+
// RandomAccessFile fileOutputStream = new RandomAccessFile(f, "rw");
296+
// FileChannel channel = fileOutputStream.getChannel();
297+
//
298+
//// channel.write(ByteBuffer.wrap(serialized.getBytes()));
299+
//
300+
// ByteBuffer buff = channel.map(FileChannel.MapMode.READ_WRITE, append ? channel.size() : 0, serialized.length());
301+
// buff.put(serialized.getBytes());
302+
//
303+
// channel.force(true);
304+
// channel.close();
305+
// fileOutputStream.close();
291306
}
292307

293308
/**
@@ -305,7 +320,7 @@ public String Stringify(Object... args) throws IOException
305320
}
306321

307322
/**
308-
* @param source | Source {@link OutputStream} to serialize variables and objects into!
323+
* @param outputStream | Source {@link OutputStream} to serialize variables and objects into!
309324
* @param args | Additional arguments to use, exact usage and behavior of them is based on specific implementation of this function (they should not be serialized)!
310325
*
311326
* @return Source {@link OutputStream} with variables and objects serialized in specific format (may or may not be flushed).
@@ -382,10 +397,8 @@ public <S extends Scope> S LoadFrom(InputStream stream, Object... parserArgs)
382397

383398
/**
384399
* @param reader | Any {@link Reader} with serialized objects in specific format to load.
385-
* @param parserArgs | Additional arguments to use, exact usage and behavior of them is based on specific implementation of this function (probably used for formating of incoming information)!
386400
*
387-
* @return Unserialized objects and variables in {@link Scope} or empty {@link Scope} if string is empty.
388-
* You can use negative indexes to get objects from back of this array since 1.1.0 (-1 = last element)!
401+
* @return This scope after loading data from reader (you most likely want to return "this")!
389402
*
390403
* @since 1.2.5
391404
*/

SerialX-juss/src/main/java/org/ugp/serialx/juss/JussSerializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,11 @@ else if (ch == '}' || ch == ']')
500500
}
501501

502502
/**
503-
* @return Formated content of reader ready to parse!
503+
* @return Formated content of reader ready to parse! Should not modify this object in any way!
504504
*
505505
* @since 1.3.2
506506
*/
507-
protected StringBuilder readAndFormat(Reader reader, boolean format)
507+
public StringBuilder readAndFormat(Reader reader, boolean format)
508508
{
509509
int quote = 0, multLineCom = -1;
510510
//int brackets = 0, lastIndex = 0, delChars = 0;

0 commit comments

Comments
 (0)