protected void applyAnnotationConstraint(ArchetypeConstraint constraint, String annotation) { if(annotation == null || annotation.length() == 0) { return; } constraint.setAnnotation(annotation); }
/** * Two CAttributes equals if have same values * * @param o * @return true if equals */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CAttribute )) return false; final CAttribute cattr = (CAttribute) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(rmAttributeName, cattr.rmAttributeName) .append(existence, cattr.existence) .append(children, cattr.children) .isEquals(); }
/** * Return a hash code of this object * * @return hash code */ public int hashCode() { return new HashCodeBuilder(5, 23) .appendSuper(super.hashCode()) .append(rmTypeName) .append(occurrences) .append(nodeID) .toHashCode(); }
log.debug("applying value constraint on path: " + constraint.path());
protected void applyValueConstraint(Archetype archetype, ArchetypeConstraint constraint, Statement rule) throws FlatteningException { if (rule.getConstraint() == null) { return; } log.debug("applying value constraint on path: " + constraint.path()); if (!(constraint instanceof CComplexObject)) { throw new FlatteningException("Unexpected constraint type: " + (constraint.getClass())); } CComplexObject ccobj = (CComplexObject) constraint; if (!ccobj.getRmTypeName().equalsIgnoreCase(ELEMENT)) { throw new FlatteningException("Unexpected constraint rmType: " + ccobj.getRmTypeName()); } ValueConstraint vc = rule.getConstraint(); if (vc instanceof TextConstraint) { TextConstraint tc = (TextConstraint) vc; applyTextConstraint(ccobj, tc); } if (vc instanceof QuantityConstraint) { QuantityConstraint tc = (QuantityConstraint) vc; applyQuantityConstraint(ccobj, tc); archetype.updatePathNodeMapRecursively(ccobj); } else if (vc instanceof MultipleConstraint) { MultipleConstraint mc = (MultipleConstraint) vc; applyMultipleConstraint(ccobj, mc); } }
log.debug("applying value constraint on path: " + constraint.path());
protected void applyAnnotationConstraint(ArchetypeConstraint constraint, String annotation) { if(annotation == null || annotation.length() == 0) { return; } constraint.setAnnotation(annotation); }
/** * Return a hash code of this object * * @return hash code */ public int hashCode() { return new HashCodeBuilder(5, 23) .appendSuper(super.hashCode()) .append(rmTypeName) .append(occurrences) .append(nodeID) .toHashCode(); }
/** * Equals if two CObject has same values * * @param o * @return true if equals */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CObject )) return false; final CObject cobj = (CObject) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(rmTypeName, cobj.rmTypeName) .append(occurrences, cobj.occurrences) .append(nodeID, cobj.nodeID) .isEquals(); }
protected void applyAnnotationConstraint(ArchetypeConstraint constraint, String annotation) { if (annotation == null || annotation.length() == 0) { return; } constraint.setAnnotation(annotation); }
/** * Return a hash code of this object * * @return hash code */ public int hashCode() { return new HashCodeBuilder(7, 19) .appendSuper(super.hashCode()) .append(rmAttributeName) .append(existence) .append(children) .toHashCode(); }
/** * Two CAttributes equals if have same values * * @param o * @return true if equals */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CAttribute )) return false; final CAttribute cattr = (CAttribute) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(rmAttributeName, cattr.rmAttributeName) .append(existence, cattr.existence) .append(children, cattr.children) .isEquals(); }
/** * Return a hash code of this object * * @return hash code */ public int hashCode() { return new HashCodeBuilder(7, 19) .appendSuper(super.hashCode()) .append(rmAttributeName) .append(existence) .append(children) .toHashCode(); }
/** * Equals if two CObject has same values * * @param o * @return true if equals */ public boolean equals(Object o) { if (this == o) return true; if (!( o instanceof CObject )) return false; final CObject cobj = (CObject) o; return new EqualsBuilder() .appendSuper(super.equals(o)) .append(rmTypeName, cobj.rmTypeName) .append(occurrences, cobj.occurrences) .append(nodeID, cobj.nodeID) .isEquals(); }
+ localPath + "constraint: " + constraint.path());
localPath + "constraint: " + constraint.path());
localPath + "constraint: " + constraint.path());