Package org.intermine.api.profile
Class PathQueryUpdate
- java.lang.Object
-
- org.intermine.api.profile.PathQueryUpdate
-
- Direct Known Subclasses:
TemplateQueryUpdate
public class PathQueryUpdate extends java.lang.Object
Class for updating a pathquery with a new model- Author:
- Daniela BUtano
-
-
Constructor Summary
Constructors Constructor Description PathQueryUpdate()
Default constructorPathQueryUpdate(PathQuery pathQuery, Model oldModel)
Construct with pathquery and former model
-
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 inputprotected 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 fieldsPathQuery
getUpdatedPathQuery()
Return a new pathquery updated to the new modelboolean
isUpdated()
Return true if the pathquery has been updatedjava.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 queryprotected 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
-
-
-
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 classesrenamedFields
- 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 classesrenamedFields
- 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 contraintnewPath
- 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 updaterenamedClasses
- the renamed classesrenamedFields
- the renamed fields- Returns:
- the updated path
- Throws:
PathException
- if there is problem in some paths
-
-