private void deriveDoc(Method redeclared, Method method) { String doc = DocumentationUtil.getScopedDescription(redeclared); if (!whitespace().matchesAllOf(Strings.nullToEmpty((doc)))) { // Don't derive as it is overridden. return; } ElementDocumentationAttribute sourceAttrib = method.getAttribute(ElementDocumentationAttribute.KEY); if (sourceAttrib != null) { redeclared.putAttribute(ElementDocumentationAttribute.KEY, sourceAttrib); } }
private void deriveDoc(Method redeclared, Method method) { String doc = DocumentationUtil.getScopedDescription(redeclared); if (!whitespace().matchesAllOf(Strings.nullToEmpty((doc)))) { // Don't derive as it is overridden. return; } ElementDocumentationAttribute sourceAttrib = method.getAttribute(ElementDocumentationAttribute.KEY); if (sourceAttrib != null) { redeclared.putAttribute(ElementDocumentationAttribute.KEY, sourceAttrib); } }
private void merge(Method method) { // TODO(user): Cleanup the use of apiVersion restVersions (VersionAttribute vs // RestVersionsAttribute) in the tools framework. Some references are using the attributes // incorrectly due to the confusion caused by the names. String apiVersion = deriveApiVersion(method); Set<String> restVersions = calculateRestVersions(method); method.putAttribute(VersionAttribute.KEY, VersionAttribute.create(apiVersion)); // UM uses the logical version with a suffix appended, if defined. String versionSuffix = method.getModel().getApiV1VersionSuffix(); method.putAttribute(VersionAttribute.USAGE_MANAGER_KEY, VersionAttribute.create(ApiVersionUtil.appendVersionSuffix(apiVersion, versionSuffix))); // Add the rest versions into RestVersionsAttribute only if parent of the method is included in // the model roots. if (roots.contains(method.getParent())) { if (getModel().hasAttribute(RestVersionsAttribute.KEY)) { getModel().getAttribute(RestVersionsAttribute.KEY).getVersions().addAll(restVersions); } else { getModel().putAttribute(RestVersionsAttribute.KEY, new RestVersionsAttribute(restVersions)); } } }
private void merge(Method method) { // TODO(user): Cleanup the use of apiVersion restVersions (VersionAttribute vs // RestVersionsAttribute) in the tools framework. Some references are using the attributes // incorrectly due to the confusion caused by the names. String apiVersion = deriveApiVersion(method); Set<String> restVersions = calculateRestVersions(method); method.putAttribute(VersionAttribute.KEY, VersionAttribute.create(apiVersion)); // UM uses the logical version with a suffix appended, if defined. String versionSuffix = method.getModel().getApiV1VersionSuffix(); method.putAttribute(VersionAttribute.USAGE_MANAGER_KEY, VersionAttribute.create(ApiVersionUtil.appendVersionSuffix(apiVersion, versionSuffix))); // Add the rest versions into RestVersionsAttribute only if parent of the method is included in // the model roots. if (roots.contains(method.getParent())) { if (getModel().hasAttribute(RestVersionsAttribute.KEY)) { getModel().getAttribute(RestVersionsAttribute.KEY).getVersions().addAll(restVersions); } else { getModel().putAttribute(RestVersionsAttribute.KEY, new RestVersionsAttribute(restVersions)); } } }
redeclared.putAttribute(HttpAttribute.KEY, sourceAttrib.reroot(effectiveRoot)); redeclared.putAttribute(VersionAttribute.KEY, VersionAttribute.create(effectiveVersion));
redeclared.putAttribute(HttpAttribute.KEY, sourceAttrib.reroot(effectiveRoot)); redeclared.putAttribute(VersionAttribute.KEY, VersionAttribute.create(effectiveVersion));