public class PropertyRegistrationList extends ArrayList<PropertyRegistration>
Registrations that share the same inner path (that is, the same nested inner class parents) can just be added with no inner path specified and they will be assumed to use the same path as the previous entry.
Since the source code that calls these add methods is generated and potentially verbose, its nice to have an efficient way to do it.
This class is modifiable and it is assumed that a new list is generated each time it is requested, ie, an instance is constructed directly in a 'get' method. The get method will likely only be called once during its lifecycle.
Property.
Matching service files are also generated in the "META-INF/services/"
directory so the PropertyRegistrar instances can be discovered
through the java.util.ServiceLoader mechanism.
At run time, the PropertyRegistrarLoader discovers all
PropertyRegistrar instances.
Each PropertyRegistrar creates a PropertyRegistrationList
instance with a PropertyRegistration for each Property
present in the jar.
modCount| Constructor and Description |
|---|
PropertyRegistrationList(String classCanonName)
Construct a new registration list for properties in a specific top level
class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(PropertyRegistration reg)
Adds a registration using the innerPath specified in the passed registration.
|
boolean |
add(String name)
Adds a property registration with the same path as the previously
added one.
|
boolean |
add(String name,
List<String> innerPath)
Adds a property registration with a specified path.
|
boolean |
add(String name,
String... innerPath)
Adds a property registration with a specified path.
|
String |
getRootCanonicalName()
The root / top level class which contains (either directly or indirectly)
the properties listed within it.
|
void |
sort()
Sorts in lexagraphical order.
|
add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic PropertyRegistrationList(String classCanonName)
classCanonName - The fully qualified canonical path of the root class.public String getRootCanonicalName()
public boolean add(PropertyRegistration reg)
add in interface Collection<PropertyRegistration>add in interface List<PropertyRegistration>add in class ArrayList<PropertyRegistration>reg - The PropertyRegistration to add to the end of the list.public boolean add(String name)
name - Name of the AndHow property, which is the name of the variable it
is assigned to at construction.public boolean add(String name, String... innerPath)
name - Name of the AndHow property, which is the name of the variable it
is assigned to at construction.innerPath - public boolean add(String name, List<String> innerPath)
name - Name of the AndHow property, which is the name of the variable it
is assigned to at construction.innerPath - The 'path' of nested inner class/interfaces from outer to innerpublic void sort()
Copyright © 2022. All rights reserved.