/** * Get extra diagnostic information about why a supplied item does not conform to this * item type, if available. If extra information is returned, it should be in the form of a complete * sentence, minus the closing full stop. No information should be returned for obvious cases. * * @param item the item that doesn't match this type * @param th the type hierarchy cache * @return optionally, a message explaining why the item does not match the type */ @Override public Optional<String> explainMismatch(Item item, TypeHierarchy th) { if (item instanceof NodeInfo) { UType actualKind = UType.getUType(item); if (!getUType().overlaps(actualKind)) { return Optional.of("The supplied value is " + actualKind.toStringWithIndefiniteArticle()); } return Optional.empty(); } else { return Optional.of("The supplied value is " + item.getGenre().getDescription()); } }
/** * Get extra diagnostic information about why a supplied item does not conform to this * item type, if available. If extra information is returned, it should be in the form of a complete * sentence, minus the closing full stop. No information should be returned for obvious cases. * * @param item the item that doesn't match this type * @param th the type hierarchy cache * @return optionally, a message explaining why the item does not match the type */ @Override public Optional<String> explainMismatch(Item item, TypeHierarchy th) { if (item instanceof NodeInfo) { UType actualKind = UType.getUType(item); if (!getUType().overlaps(actualKind)) { return Optional.of("The supplied value is " + actualKind.toStringWithIndefiniteArticle()); } return Optional.empty(); } else { return Optional.of("The supplied value is " + item.getGenre().getDescription()); } }
/** * Get extra diagnostic information about why a supplied item does not conform to this * item type, if available. If extra information is returned, it should be in the form of a complete * sentence, minus the closing full stop. No information should be returned for obvious cases. * * @param item the item that doesn't match this type * @param th the type hierarchy cache * @return optionally, a message explaining why the item does not match the type */ @Override public Optional<String> explainMismatch(Item item, TypeHierarchy th) { Optional<String> explanation = super.explainMismatch(item, th); if (explanation.isPresent()) { return explanation; } if (item instanceof NodeInfo) { UType actualKind = UType.getUType(item); if (!getUType().overlaps(actualKind)) { return Optional.of("The supplied value is " + actualKind.toStringWithIndefiniteArticle()); } else { return Optional.empty(); } } else { return Optional.of("The supplied value is " + item.getGenre().getDescription()); } }
/** * Get extra diagnostic information about why a supplied item does not conform to this * item type, if available. If extra information is returned, it should be in the form of a complete * sentence, minus the closing full stop. No information should be returned for obvious cases. * * @param item the item that doesn't match this type * @param th the type hierarchy cache * @return optionally, a message explaining why the item does not match the type */ @Override public Optional<String> explainMismatch(Item item, TypeHierarchy th) { Optional<String> explanation = super.explainMismatch(item, th); if (explanation.isPresent()) { return explanation; } if (item instanceof NodeInfo) { UType actualKind = UType.getUType(item); if (!getUType().overlaps(actualKind)) { return Optional.of("The supplied value is " + actualKind.toStringWithIndefiniteArticle()); } else { return Optional.empty(); } } else { return Optional.of("The supplied value is " + item.getGenre().getDescription()); } }
if (warnings) { visitor.issueWarning("The " + AxisInfo.axisName[axis] + " axis will never select " + test.getUType().toStringWithIndefiniteArticle(), getLocation()); if (warnings) { visitor.issueWarning("The " + AxisInfo.axisName[axis] + " axis starting at " + originUType.toStringWithIndefiniteArticle() + " will never select anything", getLocation()); if (warnings) { visitor.issueWarning("The " + AxisInfo.axisName[axis] + " axis starting at " + originUType.toStringWithIndefiniteArticle() + " will never select " + test.getUType().toStringWithIndefiniteArticle(), getLocation());
if (warnings) { visitor.issueWarning("The " + AxisInfo.axisName[axis] + " axis will never select " + test.getUType().toStringWithIndefiniteArticle(), getLocation()); if (warnings) { visitor.issueWarning("The " + AxisInfo.axisName[axis] + " axis starting at " + originUType.toStringWithIndefiniteArticle() + " will never select anything", getLocation()); if (warnings) { visitor.issueWarning("The " + AxisInfo.axisName[axis] + " axis starting at " + originUType.toStringWithIndefiniteArticle() + " will never select " + test.getUType().toStringWithIndefiniteArticle(), getLocation());