Package org.eolang.jeo.representation
Class PrefixedName
java.lang.Object
org.eolang.jeo.representation.PrefixedName
Java name handler for avoiding naming conflicts with EO-reserved words.
This class is used to represent any Java class or method name and provides encoding/decoding functionality to avoid naming conflicts with EO-reserved words. Names are prefixed with "j$" to distinguish them from EO keywords.
You can read more about the problem here
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPrefixedName(String origin) Constructor.PrefixedName(String prefix, String origin) Constructor.PrefixedName(String prefix, String origin, Pattern delimited, Pattern prefixed) Constructor. -
Method Summary
-
Constructor Details
-
PrefixedName
Constructor.- Parameters:
origin- The original name.
-
PrefixedName
Constructor.- Parameters:
prefix- Prefix to be used for encoding and decodingorigin- The original name.
-
PrefixedName
Constructor.- Parameters:
prefix- Prefix to be used for encoding and decodingorigin- The original namedelimited- Pattern to find positions for prefixingprefixed- Pattern to find existing prefixes for removal
-
-
Method Details
-
encode
Encode name.- Returns:
- Encoded name.
-
decode
Decode name.- Returns:
- Decoded name.
-