Class DotNetPathParser
app-settings-path := 'appSettings.' shorthand-key [ '.@value' ] connection-strings-path := 'connectionStrings.' shorthand-name [ '.@connectionString' | '.@providerName' ] shorthand-key := quoted | raw-literal
The remainder after the prefix is deliberately not split on dots. A .NET application
setting is routinely named Logging.LogLevel.Default or BankApi:Key, and treating
those as navigation would make the most common real key shapes unaddressable.
Ambiguity between a literal key that ends in .@value and an explicit terminal selector
is resolved greedily — at most one trailing selector is recognised — with quoting as the escape
hatch. See the worked cases in parse(String).
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisShorthand(String path) Reports whetherpathis claimed by one of the shorthands (SRS section 6.1 rule 2).static DotNetPathParses an XML shorthand path.
-
Method Details
-
isShorthand
Reports whetherpathis claimed by one of the shorthands (SRS section 6.1 rule 2).This is the single definition of the shorthand/generic boundary: callers route on it and
parse(String)claims a path on the same test, so the two cannot disagree about who owns a path. The decision is lexical — it reads only the path, never the document — so no file content can change how a path is interpreted. -
parse
Parses an XML shorthand path.Worked cases from SRS section 8.2:
appSettings.ApiUrl-> keyApiUrl, attributevalueappSettings.Logging.LogLevel.Default-> keyLogging.LogLevel.DefaultappSettings.@value-> key@value(no dot separator, so no selector)appSettings.Foo.@value.@value-> keyFoo.@value, attributevalueappSettings.'Literal.Key.Ending.@value'-> that whole quoted string as the key
- Throws:
SpliceException-ErrorCode.XML_PATH_UNSUPPORTEDif the path is not one of the two supported shorthands,ErrorCode.PATH_SYNTAXif it is malformed
-