Class MiniLangUtil


  • public final class MiniLangUtil
    extends java.lang.Object
    Mini-language utilities.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean autoCorrectOn()
      Returns true if the Mini-language script engine has been configured to auto-correct version changes.
      static void callMethod​(MethodOperation operation, MethodContext methodContext, java.util.List<MethodObject<?>> parameters, java.lang.Class<?> methodClass, java.lang.Object methodObject, java.lang.String methodName, FlexibleMapAccessor<java.lang.Object> retFieldFma)
      Calls an object method.
      static boolean containsScript​(java.lang.String str)
      Returns true if str contains a script.
      static java.lang.Object convertType​(java.lang.Object obj, java.lang.Class<?> targetClass, java.util.Locale locale, java.util.TimeZone timeZone, java.lang.String format)
      Returns obj converted to the type specified in targetClass.
      static void flagDocumentAsCorrected​(org.w3c.dom.Element element)
      Flags a Mini-language XML document as corrected.
      static java.lang.Class<?> getObjectClassForConversion​(java.lang.Object object)
      Returns a object-derived Class that is suitable for use with the conversion framework.
      static boolean isConstantAttribute​(java.lang.String attributeValue)
      Returns true if attributeValue is a constant value (it does not contain an expression).
      static boolean isConstantPlusExpressionAttribute​(java.lang.String attributeValue)
      Returns true if attributeValue is a constant value (it does not contain an expression) or a constant plus expression value.
      static boolean isDocumentAutoCorrected​(org.w3c.dom.Document document)
      Returns true if document contains corrections.
      static void writeMiniLangDocument​(java.net.URL xmlURL, org.w3c.dom.Document document)
      Writes a Mini-language Document to disk.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • containsScript

        public static boolean containsScript​(java.lang.String str)
        Returns true if str contains a script.
        Parameters:
        str - The string to test
        Returns:
        true if str contains a script
      • autoCorrectOn

        public static boolean autoCorrectOn()
        Returns true if the Mini-language script engine has been configured to auto-correct version changes.
        Returns:
        true if the Mini-language script engine has been configured to auto-correct version changes
      • callMethod

        public static void callMethod​(MethodOperation operation,
                                      MethodContext methodContext,
                                      java.util.List<MethodObject<?>> parameters,
                                      java.lang.Class<?> methodClass,
                                      java.lang.Object methodObject,
                                      java.lang.String methodName,
                                      FlexibleMapAccessor<java.lang.Object> retFieldFma)
                               throws MiniLangRuntimeException
        Calls an object method.
        Parameters:
        operation - A reference to the MethodOperation calling this method
        methodContext -
        parameters -
        methodClass -
        methodObject -
        methodName -
        retFieldFma -
        Throws:
        MiniLangRuntimeException
      • convertType

        public static java.lang.Object convertType​(java.lang.Object obj,
                                                   java.lang.Class<?> targetClass,
                                                   java.util.Locale locale,
                                                   java.util.TimeZone timeZone,
                                                   java.lang.String format)
                                            throws java.lang.Exception
        Returns obj converted to the type specified in targetClass.
        Parameters:
        obj -
        targetClass -
        locale -
        timeZone -
        format -
        Returns:
        The converted object
        Throws:
        java.lang.Exception
      • flagDocumentAsCorrected

        public static void flagDocumentAsCorrected​(org.w3c.dom.Element element)
        Flags a Mini-language XML document as corrected.
        Parameters:
        element -
      • getObjectClassForConversion

        public static java.lang.Class<?> getObjectClassForConversion​(java.lang.Object object)
        Returns a object-derived Class that is suitable for use with the conversion framework. If the argument is null or a String, the method returns the MiniLangUtil.PlainString class.
        Parameters:
        object -
        Returns:
        A Class that is suitable for use with the conversion framework
      • isConstantAttribute

        public static boolean isConstantAttribute​(java.lang.String attributeValue)
        Returns true if attributeValue is a constant value (it does not contain an expression).
        Parameters:
        attributeValue - The value to test
        Returns:
        true if attributeValue is a constant value
      • isConstantPlusExpressionAttribute

        public static boolean isConstantPlusExpressionAttribute​(java.lang.String attributeValue)
        Returns true if attributeValue is a constant value (it does not contain an expression) or a constant plus expression value.
        Parameters:
        attributeValue - The value to test
        Returns:
        true if attributeValue is a constant value or a constant plus expression value
      • isDocumentAutoCorrected

        public static boolean isDocumentAutoCorrected​(org.w3c.dom.Document document)
        Returns true if document contains corrections.
        Parameters:
        document - The document to test
        Returns:
        true if document contains corrections
      • writeMiniLangDocument

        public static void writeMiniLangDocument​(java.net.URL xmlURL,
                                                 org.w3c.dom.Document document)
        Writes a Mini-language Document to disk. The XML file is styled by the config/MiniLang.xslt style sheet.
        Parameters:
        xmlURL -
        document -