Provides various methods for working with Java identifiers.
More...
|
| static bool | IsPackageName (string name) |
| | Returns true if the given name is a legal package name.
|
| |
| static bool | IsPackageName (ReadOnlySpan< char > name) |
| | Returns true if the given name is a legal package name.
|
| |
| static bool | IsClassName (string name) |
| | Returns true if the given name is a legal class name.
|
| |
| static bool | IsClassName (ReadOnlySpan< char > name) |
| | Returns true if the given name is a legal class name.
|
| |
| static bool | IsTypeName (ReadOnlySpan< char > name) |
| | Returns true if name is a valid Java type name.
|
| |
| static bool | IsJavaIdentifier (ReadOnlySpan< char > value) |
| | Returns true if the given string is a legal Java identifier, otherwise false.
|
| |
Provides various methods for working with Java identifiers.
Definition at line 10 of file Identifer.cs.
◆ IsClassName() [1/2]
| static bool IKVM.CoreLib.Modules.Identifer.IsClassName |
( |
ReadOnlySpan< char > | name | ) |
|
|
static |
Returns true if the given name is a legal class name.
- Parameters
-
- Returns
Definition at line 57 of file Identifer.cs.
58 {
60 }
static bool IsTypeName(ReadOnlySpan< char > name)
Returns true if name is a valid Java type name.
◆ IsClassName() [2/2]
| static bool IKVM.CoreLib.Modules.Identifer.IsClassName |
( |
string | name | ) |
|
|
static |
Returns true if the given name is a legal class name.
- Parameters
-
- Returns
Definition at line 47 of file Identifer.cs.
48 {
50 }
static bool IsClassName(string name)
Returns true if the given name is a legal class name.
◆ IsJavaIdentifier()
| static bool IKVM.CoreLib.Modules.Identifer.IsJavaIdentifier |
( |
ReadOnlySpan< char > | value | ) |
|
|
static |
Returns true if the given string is a legal Java identifier, otherwise false.
Definition at line 86 of file Identifer.cs.
87 {
88 if (value.IsWhiteSpace())
89 return false;
90
91 foreach (var i in RESERVED)
92 if (value.SequenceEqual(i))
93 return false;
94
95
96 return true;
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112 }
◆ IsPackageName() [1/2]
| static bool IKVM.CoreLib.Modules.Identifer.IsPackageName |
( |
ReadOnlySpan< char > | name | ) |
|
|
static |
Returns true if the given name is a legal package name.
- Parameters
-
- Returns
Definition at line 37 of file Identifer.cs.
◆ IsPackageName() [2/2]
| static bool IKVM.CoreLib.Modules.Identifer.IsPackageName |
( |
string | name | ) |
|
|
static |
Returns true if the given name is a legal package name.
- Parameters
-
- Returns
Definition at line 27 of file Identifer.cs.
28 {
30 }
static bool IsPackageName(string name)
Returns true if the given name is a legal package name.
◆ IsTypeName()
| static bool IKVM.CoreLib.Modules.Identifer.IsTypeName |
( |
ReadOnlySpan< char > | name | ) |
|
|
static |
Returns true if name is a valid Java type name.
- Parameters
-
- Returns
Definition at line 67 of file Identifer.cs.
68 {
69 int next;
70 int off = 0;
71 while ((next = name[off..].IndexOf(['.'])) != -1)
72 {
73 var id = name.Slice(off, next);
75 return false;
76
77 off = next + 1;
78 }
79
81 }
static bool IsJavaIdentifier(ReadOnlySpan< char > value)
Returns true if the given string is a legal Java identifier, otherwise false.
The documentation for this class was generated from the following file: