Parse the pre req list @param kind The kind of the prerequisite (less the "PRE" prefix) @param formula The body of the prerequisite. @param invertResult Whether the prerequisite should invert the result. @param overrideQualify if set true, this prerequisite will be enforced in spite
(String kind, String formula, boolean invertResult, boolean overrideQualify)
| 55 | * @throws PersistenceLayerException |
| 56 | */ |
| 57 | @Override |
| 58 | public Prerequisite parse(String kind, String formula, boolean invertResult, boolean overrideQualify) |
| 59 | throws PersistenceLayerException |
| 60 | { |
| 61 | Prerequisite prereq = super.parse(kind, formula, invertResult, overrideQualify); |
| 62 | try |
| 63 | { |
| 64 | prereq.setKind("size"); |
| 65 | |
| 66 | // Get the comparator type SIZEGTEQ, BSIZE, SIZENEQ etc. |
| 67 | String compType = kind.substring(4); |
| 68 | if (compType.isEmpty()) |
| 69 | { |
| 70 | compType = "gteq"; |
| 71 | } |
| 72 | prereq.setOperator(compType); |
| 73 | |
| 74 | String abb = formula.substring(0, 1); |
| 75 | |
| 76 | LoadContext context = Globals.getContext(); |
| 77 | CDOMSingleRef<SizeAdjustment> ref = |
| 78 | context.getReferenceContext().getCDOMReference(SizeAdjustment.class, abb); |
| 79 | context.forgetMeNot(ref); |
| 80 | |
| 81 | prereq.setOperand(formula); |
| 82 | if (invertResult) |
| 83 | { |
| 84 | prereq.setOperator(prereq.getOperator().invert()); |
| 85 | } |
| 86 | } |
| 87 | catch (PrerequisiteException pe) |
| 88 | { |
| 89 | throw new PersistenceLayerException( |
| 90 | "Unable to parse the prerequisite :'" + kind + ':' + formula + "'. " + pe.getLocalizedMessage(), pe); |
| 91 | } |
| 92 | return prereq; |
| 93 | } |
| 94 | } |
nothing calls this directly
no test coverage detected