Skip to content

Commit 5385b4e

Browse files
Java doc fixes
1 parent 6f506c5 commit 5385b4e

File tree

14 files changed

+46
-29
lines changed

14 files changed

+46
-29
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void add(int index, E element)
8686
{
8787
E contained = get((Class<? extends E>) element.getClass());
8888
if (contained != null)
89-
remove(contained);
89+
remove(contained);
9090
super.add(index, element);
9191
}
9292

@@ -128,8 +128,6 @@ protected void addDuplicatively(int index, E element)
128128
/**
129129
* @param elms | Array o elements to add!
130130
*
131-
* @return {@link Registry#addAll(int, Object...)}
132-
*
133131
* @since 1.3.0
134132
*/
135133
public void addAll(@SuppressWarnings("unchecked") E... elms)
@@ -138,10 +136,9 @@ public void addAll(@SuppressWarnings("unchecked") E... elms)
138136
}
139137

140138
/**
139+
* @param index | Index at which the specified elements should be inserted
141140
* @param elms | Array o elements to add!
142141
*
143-
* @return {@link Registry#addAll(int, Collection)}
144-
*
145142
* @since 1.3.0
146143
*/
147144
public void addAll(int index, @SuppressWarnings("unchecked") E... elms)
@@ -219,9 +216,9 @@ public int addBefore(Class<? extends E> cls, boolean includeChildrens, E element
219216
*
220217
* @since 1.3.0
221218
*/
222-
public void addAllBefore(Class<? extends E> cls, @SuppressWarnings("unchecked") E... element)
219+
public int addAllBefore(Class<? extends E> cls, @SuppressWarnings("unchecked") E... element)
223220
{
224-
addAllBefore(cls, false, element);
221+
return addAllBefore(cls, false, element);
225222
}
226223

227224
/**

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ public Scope getScope(int scopeValueIndex)
615615
}
616616

617617
/**
618-
* @param scopesOrderIndex | Order index of sub-scope.
618+
* @param subscopesOrderIndex | Order index of sub-scope.
619619
*
620620
* @return Sub-scope with required number. Similar to {@link Scope#getScope(int)} however this will ignore non scope values.
621621
* <br><br>
@@ -732,9 +732,9 @@ public <T> T toObjectOf(int scopesValueIndex, Class<T> objClass) throws Exceptio
732732
*
733733
* @since 1.2.5
734734
*/
735-
public <T> T toObjectOf(String variableWithscope, Class<T> objClass) throws Exception
735+
public <T> T toObjectOf(String variableWithScope, Class<T> objClass) throws Exception
736736
{
737-
return toObjectOf(variableWithscope, objClass, null);
737+
return toObjectOf(variableWithScope, objClass, null);
738738
}
739739

740740
/**
@@ -752,9 +752,9 @@ public <T> T toObjectOf(String variableWithscope, Class<T> objClass) throws Exce
752752
*
753753
* @since 1.2.5
754754
*/
755-
public <T> T toObjectOf(String variableWithscope, Class<T> objClass, T defaultValue) throws Exception
755+
public <T> T toObjectOf(String variableWithScope, Class<T> objClass, T defaultValue) throws Exception
756756
{
757-
return toObjectOf(variableWithscope, objClass, defaultValue, SerializationProtocol.REGISTRY);
757+
return toObjectOf(variableWithScope, objClass, defaultValue, SerializationProtocol.REGISTRY);
758758
}
759759

760760
/**
@@ -774,9 +774,9 @@ public <T> T toObjectOf(String variableWithscope, Class<T> objClass, T defaultVa
774774
* @since 1.3.2
775775
*/
776776
@SuppressWarnings("unchecked")
777-
public <T> T toObjectOf(String variableWithscope, Class<T> objClass, T defaultValue, ProtocolRegistry protocolsToUse) throws Exception
777+
public <T> T toObjectOf(String variableWithScope, Class<T> objClass, T defaultValue, ProtocolRegistry protocolsToUse) throws Exception
778778
{
779-
T obj = get(variableWithscope, defaultValue);
779+
T obj = get(variableWithScope, defaultValue);
780780
if (obj instanceof GenericScope)
781781
return ((GenericScope<String, ?>) obj).toObject(objClass, protocolsToUse);
782782
return obj;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ public String toString(boolean serialize) throws IOException
265265
* @param f | File to write in. This must be a text file.
266266
* @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)!
267267
*
268-
* @return String with variables and objects serialized in specific format.
269-
*
270268
* @throws IOException if file can't be opened or serialization fails!
271269
*
272270
* @since 1.1.5
@@ -281,8 +279,6 @@ public void serializeTo(File f, Object... args) throws IOException
281279
* @param f | File to write in. This must be a text file.
282280
* @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)!
283281
*
284-
* @return String with variables and objects serialized in specific format.
285-
*
286282
* @throws IOException if file can't be opened or serialization fails!
287283
*
288284
* @since 1.1.5
@@ -349,6 +345,8 @@ public OutputStream serializeTo(OutputStream outputStream, Object... args) throw
349345
*
350346
* @return Source {@link Appendable} with variables and objects serialized in specific format.
351347
*
348+
* @throws IOException depends on the implementation (likely when the provided source throws).
349+
*
352350
* @since 1.3.2
353351
*/
354352
public abstract <A extends Appendable> A serializeTo(A source, Object... args) throws IOException;
@@ -456,9 +454,11 @@ public Serializer emptyClone(Scope parent) throws Exception
456454
}
457455

458456
/**
457+
* @param typeOfClone | Specific type of the clone (has to extend Serializer).
459458
* @param parent | Parent scope of new Serializer instance!
460459
*
461460
* @return Clone of this {@link Serializer} without variables and values, protocols and parser will remain same!
461+
* @throws Exception
462462
*
463463
* @since 1.3.5
464464
*/

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,17 @@ public static Class<?>[] ToClasses(Object... objs)
391391
}
392392

393393
/**
394+
* @param unwrap | If the box types should be unwrapped to primitives...
394395
* @param objs | Array of objects.
395396
*
396397
* @return Array of inserted objects class types. Wrapper types of primitive values will be converted to primitive types! For instance: Integer.class -> int.class
397398
*
398399
* @since 1.3.5
399400
*/
400-
public static Class<?>[] ToClasses(boolean unwrapp, Object... objs)
401+
public static Class<?>[] ToClasses(boolean unwrap, Object... objs)
401402
{
402403
Class<?>[] classes = new Class<?>[objs.length];
403-
if (unwrapp)
404+
if (unwrap)
404405
{
405406
for (int i = 0; i < classes.length; i++)
406407
{
@@ -771,6 +772,9 @@ public static boolean isOneOf(int ch, char... chars)
771772
}
772773

773774
/**
775+
* @param str | Char sequence to search.
776+
* @param oneOf | Chars to search for!
777+
*
774778
* @return {@link String#contains(CharSequence)} for char sequence!
775779
*
776780
* @since 1.3.0
@@ -785,7 +789,7 @@ public static boolean contains(CharSequence str, char... oneOf)
785789
return false;
786790
}
787791

788-
for (int i = 0, len = str.length(); i < len; i++)
792+
for (int i = 0, len = str.length(); i < len; i++)
789793
if (isOneOf(str.charAt(i), oneOf))
790794
return true;
791795
return false;

SerialX-core/src/main/java/org/ugp/serialx/converters/DataConverter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public static CharSequence objToString(Object obj, Object... args)
5353
}
5454

5555
/**
56+
* @param objToDescribe | Object to gen. comment for...
57+
*
5658
* @return <code>"Object of " + objToDescribe.getClass().getName() + ": \"" + objToDescribe + "\" converted by " + DataParser.class.getName()</code>
5759
*
5860
* @since 1.3.2

SerialX-core/src/main/java/org/ugp/serialx/converters/ProtocolConverter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,14 @@ else if (args[3] instanceof SerializationProtocol)
346346

347347
/**
348348
* @param str | String to check protocol class for!
349+
* @param args | Args provided by the caller. Should contain {@link ImportsProvider}-like object at index 0.
349350
*
350351
* @return Class of the protocol or null if inserted statement is not protocol expression!
351352
* For example: <code>getProtocolExprClass("java.util.ArrayList 1 2 3 4 5")</code> will return {@link ArrayList} but <code>"Hello world!"</code> will return null!
352353
*
353354
* @since 1.3.0
354355
*/
355-
public static Class<?> getProtocolExprClass(String str, Object... compilerArgs)
356+
public static Class<?> getProtocolExprClass(String str, Object... args)
356357
{
357358
int i = 0, len = str.length();
358359
for (char ch; i < len; i++)
@@ -361,7 +362,7 @@ public static Class<?> getProtocolExprClass(String str, Object... compilerArgs)
361362

362363
try
363364
{
364-
Class<?> cls = ImportsProvider.forName(compilerArgs.length > 0 ? compilerArgs[0] : null, str.substring(0, i), false, ProtocolConverter.class.getClassLoader());
365+
Class<?> cls = ImportsProvider.forName(args.length > 0 ? args[0] : null, str.substring(0, i), false, ProtocolConverter.class.getClassLoader());
365366
if (cls != null)
366367
return cls;
367368
for (char ch; i < len; i++)

SerialX-core/src/main/java/org/ugp/serialx/converters/SerializableBase64Converter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public CharSequence getDescription(ParserRegistry myHomeRegistry, Object obj, Ob
108108
*
109109
* @since 1.0.0 (moved to {@link SerializableBase64Converter} since 1.3.0)
110110
*/
111-
public static Object UnserializeClassis(String objStr) throws Exception
111+
public static Object UnserializeClassis(String objStr) throws IOException, ClassNotFoundException
112112
{
113113
return new ObjectInputStream(new ByteArrayInputStream(Base64.getDecoder().decode(objStr))).readObject();
114114
}

SerialX-core/src/main/java/org/ugp/serialx/converters/StringConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void setSerializeStringNormally(boolean serializeStringNormally)
150150
/**
151151
* @param obj | Object to stringify directly.
152152
*
153-
* @return "${" + obj + "}" - if this is be inserted into {@link StringConverter#toString(Registry, Object, Object...))}, it will be returned without ${ and }!
153+
* @return "${" + obj + "}" - if this is be inserted into {@link StringConverter#toString(Registry, Object, Object...)}, it will be returned without ${ and }!
154154
*
155155
* @since 1.3.5
156156
*/

SerialX-core/src/main/java/org/ugp/serialx/protocols/SerializationProtocol.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public String toString()
7676
*
7777
* @return Array of objects to serialize created from given object.
7878
*
79+
* @throws Exception depends on the implementation (most likely reflection related exceptions).
80+
*
7981
* @since 1.0.0
8082
*/
8183
public abstract Object[] serialize(T object) throws Exception;

SerialX-json/src/main/java/org/ugp/serialx/json/JsonSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ <th>Obtained serializer content (return)</th>
332332
</tr>
333333
</table>
334334
*
335-
* @throws When something went wrong during deserialization!
335+
* @throws Exception When something went wrong during deserialization!
336336
*
337337
* @since 1.3.5
338338
*/

0 commit comments

Comments
 (0)