Class PathQueryUpdate

  • Direct Known Subclasses:
    TemplateQueryUpdate

    public class PathQueryUpdate
    extends java.lang.Object
    Class for updating a pathquery with a new model
    Author:
    Daniela BUtano
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected PathConstraint createPathConstraint​(PathConstraint pathConstraint, java.lang.String newPath)
      Create a pathconstraint with the same operator and value of path contraint given in input and with the path given in input
      protected java.lang.String getPathUpdated​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> renamedClasses, java.util.Map<java.lang.String,​java.lang.String> renamedFields)
      Update the path given in input with the renamed classes and fields
      PathQuery getUpdatedPathQuery()
      Return a new pathquery updated to the new model
      boolean isUpdated()
      Return true if the pathquery has been updated
      java.util.List<java.lang.String> update​(java.util.Map<java.lang.String,​java.lang.String> renamedClasses, java.util.Map<java.lang.String,​java.lang.String> renamedFields)
      Update the path query
      protected void updateConstraints​(java.util.Map<java.lang.String,​java.lang.String> renamedClasses, java.util.Map<java.lang.String,​java.lang.String> renamedFields)
      Update the constraint with the renamed classes or/and fields
      • Methods inherited from class java.lang.Object

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

      • newPathQuery

        protected PathQuery newPathQuery
      • oldModel

        protected Model oldModel
      • isUpdated

        protected boolean isUpdated
    • Constructor Detail

      • PathQueryUpdate

        public PathQueryUpdate()
        Default constructor
      • PathQueryUpdate

        public PathQueryUpdate​(PathQuery pathQuery,
                               Model oldModel)
        Construct with pathquery and former model
        Parameters:
        pathQuery - the epath query
        oldModel - the former model
    • Method Detail

      • getUpdatedPathQuery

        public PathQuery getUpdatedPathQuery()
        Return a new pathquery updated to the new model
        Returns:
        the new pathquery
      • isUpdated

        public boolean isUpdated()
        Return true if the pathquery has been updated
        Returns:
        true if the pathquery has been updated, false otherwise
      • update

        public java.util.List<java.lang.String> update​(java.util.Map<java.lang.String,​java.lang.String> renamedClasses,
                                                       java.util.Map<java.lang.String,​java.lang.String> renamedFields)
                                                throws PathException
        Update the path query
        Parameters:
        renamedClasses - the renamed classes
        renamedFields - the renamed fields
        Returns:
        the list of problems
        Throws:
        PathException - if there is problem in some paths
      • updateConstraints

        protected void updateConstraints​(java.util.Map<java.lang.String,​java.lang.String> renamedClasses,
                                         java.util.Map<java.lang.String,​java.lang.String> renamedFields)
                                  throws PathException
        Update the constraint with the renamed classes or/and fields
        Parameters:
        renamedClasses - the renamed classes
        renamedFields - the renamed fields
        Throws:
        PathException - if there is problem in some paths
      • createPathConstraint

        protected PathConstraint createPathConstraint​(PathConstraint pathConstraint,
                                                      java.lang.String newPath)
        Create a pathconstraint with the same operator and value of path contraint given in input and with the path given in input
        Parameters:
        pathConstraint - the source path contraint
        newPath - the new path
        Returns:
        the path constraint created
      • getPathUpdated

        protected java.lang.String getPathUpdated​(java.lang.String path,
                                                  java.util.Map<java.lang.String,​java.lang.String> renamedClasses,
                                                  java.util.Map<java.lang.String,​java.lang.String> renamedFields)
                                           throws PathException
        Update the path given in input with the renamed classes and fields
        Parameters:
        path - the original path to update
        renamedClasses - the renamed classes
        renamedFields - the renamed fields
        Returns:
        the updated path
        Throws:
        PathException - if there is problem in some paths