type of a map entry which maps a property name as key, to a property value, and along side it is a LookupLocation object telling us where we found that property value.
type of a map entry which maps a property name as key, to a property value, and along side it is a LookupLocation object telling us where we found that property value.
The property maps/lists in DFDLFormatAnnotation have been enhanced to have this LookupLocation thing along their side to allow issuing better diagnostic messages about conflicting property definitions
Issue a warning.
Issue a warning. The WarnID enables suppression of warning messages.
Implemented in various ways by users of the mixin to find a property.
Implemented in various ways by users of the mixin to find a property. This should never be directly called to find a property. Instead one should use findPropertyOption and friends, which ensure that caching is consistent.
This will print the property value if the property has any value in scope.
This will print the property value if the property has any value in scope. This is mostly for debugging purposes.
Convert a property string value to a Boolean
Convert a property string value to a Boolean
Note: no error checking is required, as we assume the schema has already been validated, so we only have to deal with the valid formats for Boolean.
Convert a property string value to a Int
Convert a property string value to a Int
Note: no error checking is required, as we assume the schema has already been validated, so we only have to deal with the valid formats for Int.
There's no conversion to do here, but to eliminate a special case in the code generator we always generate a call to a convertToTYPE function.
There's no conversion to do here, but to eliminate a special case in the code generator we always generate a call to a convertToTYPE function.
Call this to find/get a property.
Call this to find/get a property.
Property values are non-optional in DFDL. If they're not there but a format requires them, then it's always an error.
Note also that DFDL doesn't have default values for properties. That means that most use of properties is unconditional. Get the property value, and it must be there, or its an error. There are very few exceptions to this rule.
It is ok to use getProperty if the resulting property value cannot ever contain a QName that would have to be resolved.
It is ok to use getProperty if the resulting property value cannot ever contain a QName that would have to be resolved.
Don't use this much.
Don't use this much. If an SDE needs to be reported, you won't have the source of the property to put into the message. Use findPropertyOption instead. That returns the value and the LookupLocation where it was found for use in diagnostics.
Also, don't use if the property value could ever contain a QName, because one needs that LookupLocation to resolve QNames properly.
Note: any expression can contain QNames, so no expression-valued property or one that could be a value or an expression, should ever use this or getProperty.
See JIRA DFDL-506.
SDE special case when we're blaming the error on the value of a property.
SDE special case when we're blaming the error on the value of a property. If the location where the property value is defined is different from the current context, then we inform about both the context location, and the location where the property value comes from.
* These functions are now macros as the original code: final def schemaDefinitionUnless(testThatWillThrowIfFalse: Boolean, str: => String, args: => Any*) = if (!testThatWillThrowIfFalse) SDE(str, args: _*) would cause expensive object allocation, even when the test would be true and even when the function was inlined
* These functions are now macros as the original code: final def schemaDefinitionUnless(testThatWillThrowIfFalse: Boolean, str: => String, args: => Any*) = if (!testThatWillThrowIfFalse) SDE(str, args: _*) would cause expensive object allocation, even when the test would be true and even when the function was inlined
Conditionally issue a warning.
Conditionally issue a warning. The WarnID allows warning suppression.
Conditionally issue a warning.
Conditionally issue a warning. The WarnID allows warning suppression.
Properties will push their toString function onto this list
Properties will push their toString function onto this list
Each object that has any properties mixed in must implement this value.
Centralize throwing for debug convenience
Centralize throwing for debug convenience
prints all the properties on the object.
prints all the properties on the object.
For unit testing convenience, or for use when debugging.
For unit testing convenience, or for use when debugging.
Use to make debug printing over small code regions convenient.
Use to make debug printing over small code regions convenient. Turns on your logging level of choice over a lexical region of code. Makes sure it is reset to whatever it was on the exit, even if it throws.
Call with no log level argument to turn it off (when done debugging). That way you can leave it sitting there.