Class ExpressionTranslator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int errorCount
      Stores the number of errors.
      private java.util.Map<Message,​Message> map  
      private java.util.List<Message> messages
      Stores the messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExpressionTranslator()
      Creates an expression translator (to be used within this package only).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMessage​(Message msg)
      Adds a message.
      void clearMessages​(java.net.URI uri)
      Clears all messages registered for the resource uri.
      void clearMessages​(ModelInfo<?> info)
      Clears all messages registered for info.
      void collect​(IMessage message, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causeFeature, int code)
      Receives an EASy message.
      void error​(java.lang.String message, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causeFeature, int code)
      Receives an error message.
      void error​(org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic)
      Adds a diagnostic error, typically from a standalone parser configuration.
      private Message errorImpl​(java.lang.String message, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causeFeature, int code)
      Receives an error message.
      int getErrorCount()
      Returns the number of errors.
      Message getMessage​(int index)
      Returns the specified message.
      int getMessageCount()
      Returns the number of messages.
      private static org.eclipse.emf.common.util.URI getURI​(org.eclipse.emf.ecore.EObject object)
      Returns the resource URI of object.
      private static boolean sameURIs​(java.net.URI uri, org.eclipse.emf.ecore.EObject cause)
      Checks whether uri and the URI of cause are the same.
      void warning​(java.lang.String message, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causeFeature, int code)
      Receives a warning message.
      private Message warningImpl​(java.lang.String message, org.eclipse.emf.ecore.EObject cause, org.eclipse.emf.ecore.EStructuralFeature causeFeature, int code)
      Receives a warning message.
      • Methods inherited from class java.lang.Object

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

      • messages

        private java.util.List<Message> messages
        Stores the messages.
      • errorCount

        private int errorCount
        Stores the number of errors.
    • Constructor Detail

      • ExpressionTranslator

        public ExpressionTranslator()
        Creates an expression translator (to be used within this package only).
    • Method Detail

      • getMessage

        public Message getMessage​(int index)
        Description copied from class: MessageReceiver
        Returns the specified message.
        Specified by:
        getMessage in class MessageReceiver
        Parameters:
        index - the position of the message to be returned
        Returns:
        the specified message
      • getURI

        private static org.eclipse.emf.common.util.URI getURI​(org.eclipse.emf.ecore.EObject object)
        Returns the resource URI of object.
        Parameters:
        object - the object
        Returns:
        the resource URI (may be null)
      • errorImpl

        private Message errorImpl​(java.lang.String message,
                                  org.eclipse.emf.ecore.EObject cause,
                                  org.eclipse.emf.ecore.EStructuralFeature causeFeature,
                                  int code)
        Receives an error message.
        Parameters:
        message - the message
        cause - the cause (as instance of the EMF grammar model)
        causeFeature - the cause of the feature as an appropriate constant from IvmlPackage.Literals
        code - a numerical identification of the error
        Returns:
        the created/stored message
      • warningImpl

        private Message warningImpl​(java.lang.String message,
                                    org.eclipse.emf.ecore.EObject cause,
                                    org.eclipse.emf.ecore.EStructuralFeature causeFeature,
                                    int code)
        Receives a warning message.
        Parameters:
        message - the message
        cause - the cause (as instance of the EMF grammar model)
        causeFeature - the cause of the feature as an appropriate constant from IvmlPackage.Literals
        code - a numerical identification of the warning
        Returns:
        the created/stored message
      • error

        public void error​(java.lang.String message,
                          org.eclipse.emf.ecore.EObject cause,
                          org.eclipse.emf.ecore.EStructuralFeature causeFeature,
                          int code)
        Description copied from interface: IMessageReceiver
        Receives an error message.
        Parameters:
        message - the message
        cause - the cause (as instance of the EMF grammar model)
        causeFeature - the cause of the feature as an appropriate constant from IvmlPackage.Literals
        code - a numerical identification of the error
      • warning

        public void warning​(java.lang.String message,
                            org.eclipse.emf.ecore.EObject cause,
                            org.eclipse.emf.ecore.EStructuralFeature causeFeature,
                            int code)
        Description copied from interface: IMessageReceiver
        Receives a warning message.
        Parameters:
        message - the message
        cause - the cause (as instance of the EMF grammar model)
        causeFeature - the cause of the feature as an appropriate constant from IvmlPackage.Literals
        code - a numerical identification of the warning
      • collect

        public void collect​(IMessage message,
                            org.eclipse.emf.ecore.EObject cause,
                            org.eclipse.emf.ecore.EStructuralFeature causeFeature,
                            int code)
        Description copied from interface: IMessageReceiver
        Receives an EASy message. This allows re-directing the message while keeping the relation to the original one, e.g., for cleaning up messages.
        Parameters:
        message - the message
        cause - the cause (as instance of the EMF grammar model)
        causeFeature - the cause of the feature as an appropriate constant from IvmlPackage.Literals
        code - a numerical identification of the error
      • error

        public void error​(org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic)
        Adds a diagnostic error, typically from a standalone parser configuration.
        Specified by:
        error in class MessageReceiver
        Parameters:
        diagnostic - the diagnostic to be added
      • addMessage

        public void addMessage​(Message msg)
        Adds a message.
        Specified by:
        addMessage in class MessageReceiver
        Parameters:
        msg - the message to be added
      • clearMessages

        public void clearMessages​(ModelInfo<?> info)
        Clears all messages registered for info.
        Parameters:
        info - the information object to clear the messages for
      • clearMessages

        public void clearMessages​(java.net.URI uri)
        Clears all messages registered for the resource uri.
        Parameters:
        uri - the URI to clear the messages for
      • sameURIs

        private static boolean sameURIs​(java.net.URI uri,
                                        org.eclipse.emf.ecore.EObject cause)
        Checks whether uri and the URI of cause are the same.
        Parameters:
        uri - the URI to check
        cause - the cause object to check
        Returns:
        true if both are the same, false else also if null