Class IRArgument
- java.lang.Object
-
- org.opendaylight.yangtools.yang.parser.rfc7950.ir.IRArgument
-
- All Implemented Interfaces:
Immutable
,MutationBehaviour<Immutable>
- Direct Known Subclasses:
IRArgument.Concatenation
,IRArgument.Single
@Beta public abstract class IRArgument extends Object
An argument to a YANG statement, as defined by section 6.1.3 of both RFC6020 and RFC7950. An argument is effectively any old string, except it can be defined in a number of ways:- it can be a simple unquoted string, or
- it can be a single-quoted string, with its contents being completely preserved, or
- it can be a double-quoted string, which defines some escaping and whitespace-stripping rules, or
- it can be a concatenation of any number of single- or double-quoted strings
The first three cases as covered by
IRArgument.Single
subclass, which exposes appropriate methods to infer how its string literal is to be interpreted. The last case is handled byIRArgument.Concatenation
subclass, which exposes the constituent parts asIRArgument.Single
items.Please note that parser implementations producing these argument representations are NOT required to retain the format of the original definition. They are free to perform quoting and concatenation transformations as long as they maintain semantic equivalence. As a matter of example, these transformations are explicitly allowed:
- elimination of unneeded quotes, for example turning
"foo"
intofoo
- transformation of quotes, for example turning
"foo\nbar"
into'foo
bar'
- concatenation processing, for example turning
'foo' + 'bar'
intofoobar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IRArgument.Concatenation
An argument composed of multiple concatenated parts.static class
IRArgument.Single
An argument composed of a single string.
-