Package org.simpleframework.xml.core
Class KeyBuilder
java.lang.Object
org.simpleframework.xml.core.KeyBuilder
The
KeyBuilder is used build unique keys for labels
using the paths defined in those labels. Building keys in this
way ensures that labels can be uniquely identified. This helps in
constructor injection when we need to match a parameter with a
label to determine which constructor signature should be used.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classTheKeyobject represents an object that can be used in a hash container.private static enumTheKeyTypeenumeration is used to differentiate keys created for attributes from those created from elements. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKey()This generates a key for theLabelobject that this represents.private StringThis generates a key for theLabelobject that this represents.private ObjectgetKey(KeyBuilder.KeyType type) This generates a key for theLabelobject that this represents.
-
Field Details
-
label
This is the label that the keys should be built with.
-
-
Constructor Details
-
KeyBuilder
Constructor for theKeyBuilderobject. This is used to create a builder using the provided label. A key will be unique based on the XPath options for the label.- Parameters:
label- this is the label to build he key for
-
-
Method Details
-
getKey
This generates a key for theLabelobject that this represents. Each key is generated based on the label type and the XPath options for the label. This ensures that similar labels create the same key values.- Returns:
- this returns a key to represent the label
- Throws:
Exception
-
getKey
This generates a key for theLabelobject that this represents. Each key is generated based on the label type and the XPath options for the label. This ensures that similar labels create the same key values.- Parameters:
type- this is the type that this key builder represents- Returns:
- this returns a key to represent the label
- Throws:
Exception
-
getKey
This generates a key for theLabelobject that this represents. Each key is generated based on the label type and the XPath options for the label. This ensures that similar labels create the same key values.- Parameters:
list- this is the list of XPath expressions to be used- Returns:
- this returns a key to represent the label
- Throws:
Exception
-