protected void validate() { Object attval = getAttribute(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE); if (attval != null && !(attval instanceof VersionRange)) { getAttributes().put(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE, new VersionRange(attval.toString())); } String resdir = getDirective(Namespace.REQUIREMENT_RESOLUTION_DIRECTIVE); optional = Namespace.RESOLUTION_OPTIONAL.equals(resdir); canonicalName = toString(); }
public AbstractRequirement(AbstractResource resource, String namespace, Map<String, Object> atts, Map<String, String> dirs) { if (resource == null) throw new IllegalArgumentException("Null resource"); if (namespace == null) throw new IllegalArgumentException("Null namespace"); this.resource = resource; this.namespace = namespace; if (atts != null) { getAttributes().putAll(atts); } if (dirs != null) { getDirectives().putAll(dirs); } }
String type; String nsval = null; if (IdentityNamespace.IDENTITY_NAMESPACE.equals(getNamespace())) { type = "IdentityRequirement"; } else { addcomma = true; if (!getAttributes().isEmpty()) { buffer.append(addcomma ? "," : ""); buffer.append("atts=" + attributes); addcomma = true; if (!getDirectives().isEmpty()) { buffer.append(addcomma ? "," : ""); buffer.append("dirs=" + directives);
VersionRange range = matches ? AbstractRequirement.getVersionRange(req, IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE) : null; if (range != null) { Version version = AbstractCapability.getVersion(cap, IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE);
void validate() { // Make sure we have an identity getIdentity(); // Validate the capabilities for (Capability cap : getCapabilities(null)) { ((AbstractCapability) cap).validate(); } // Validate the requirements for (Requirement req : getRequirements(null)) { ((AbstractRequirement) req).validate(); } }