/** * Given a proto element, returns its associated description. Returns {@code defaultText} if no * description is available. */ public static String getDescription(ProtoElement element, String defaultText) { return element.hasAttribute(ElementDocumentationAttribute.KEY) ? element.getAttribute(ElementDocumentationAttribute.KEY).documentation() : defaultText; }
/** * Given an ProtoElement, returns its associated deprecation description. Returns the empty string * if not available. */ public static String getDeprecationDescription(ProtoElement element) { return element.hasAttribute(ElementDocumentationAttribute.KEY) ? element.getAttribute(ElementDocumentationAttribute.KEY).deprecationDescription() : ""; }
/** * Given a proto element, returns its associated description. Returns {@code defaultText} if no * description is available. */ public static String getDescription(ProtoElement element, String defaultText) { return element.hasAttribute(ElementDocumentationAttribute.KEY) ? element.getAttribute(ElementDocumentationAttribute.KEY).documentation() : defaultText; }
/** * Given an ProtoElement, returns its associated deprecation description. Returns the empty string * if not available. */ public static String getDeprecationDescription(ProtoElement element) { return element.hasAttribute(ElementDocumentationAttribute.KEY) ? element.getAttribute(ElementDocumentationAttribute.KEY).deprecationDescription() : ""; }
private ImmutableList<String> getOauthScopes(ProtoElement element) { AuthAttribute auth = element.getAttribute(AuthAttribute.KEY); return auth != null && auth.getAuthenticationRule().hasOauth() ? ImmutableList.copyOf( OAUTH_SCOPE_SPLITTER.split( auth.getAuthenticationRule().getOauth().getCanonicalScopes())) : EMPTY_STRING_LIST; }
private ImmutableList<String> getOauthScopes(ProtoElement element) { AuthAttribute auth = element.getAttribute(AuthAttribute.KEY); return auth != null && auth.getAuthenticationRule().hasOauth() ? ImmutableList.copyOf( OAUTH_SCOPE_SPLITTER.split( auth.getAuthenticationRule().getOauth().getCanonicalScopes())) : EMPTY_STRING_LIST; }
@Override public void normalize(ProtoElement element, Service.Builder builder) { if (!isApplicable(element) || hasEmptySelector(element)) { return; } AttributeType attribute = element.getAttribute(key); if (attribute != null) { addToRuleBuilder(builder, element.getFullName(), attribute); } }
@Override public void normalize(ProtoElement element, Service.Builder builder) { if (!isApplicable(element) || hasEmptySelector(element)) { return; } AttributeType attribute = element.getAttribute(key); if (attribute != null) { addToRuleBuilder(builder, element.getFullName(), attribute); } }
@Override public void merge(ProtoElement elem) { if (!(elem instanceof Method)) { return; } // Use the first implemented method to derive properties. ImplementsAttribute attrib = elem.hasAttribute(ImplementsAttribute.KEY) ? elem.getAttribute(ImplementsAttribute.KEY).get(0) : null; if (attrib == null) { return; } Method method = (Method) elem; deriveDoc(method, attrib.method()); deriveHttp(method, attrib.method()); }
@Override public void merge(ProtoElement elem) { if (!(elem instanceof Method)) { return; } // Use the first implemented method to derive properties. ImplementsAttribute attrib = elem.hasAttribute(ImplementsAttribute.KEY) ? elem.getAttribute(ImplementsAttribute.KEY).get(0) : null; if (attrib == null) { return; } Method method = (Method) elem; deriveDoc(method, attrib.method()); deriveHttp(method, attrib.method()); }
VersionAttribute versionAttrib = redeclared.getParent().getAttribute(VersionAttribute.KEY); if (versionAttrib != null && !whitespace().matchesAllOf(Strings.nullToEmpty(versionAttrib.majorVersion()))) { redeclared.getParent().getAttribute(MixinAttribute.KEY).get(0).config().getRoot(); if (!whitespace().matchesAllOf(Strings.nullToEmpty(configuredRoot))) { if (!effectiveRoot.isEmpty()) {
VersionAttribute versionAttrib = redeclared.getParent().getAttribute(VersionAttribute.KEY); if (versionAttrib != null && !whitespace().matchesAllOf(Strings.nullToEmpty(versionAttrib.majorVersion()))) { redeclared.getParent().getAttribute(MixinAttribute.KEY).get(0).config().getRoot(); if (!whitespace().matchesAllOf(Strings.nullToEmpty(configuredRoot))) { if (!effectiveRoot.isEmpty()) {
element.getFile().putAttribute(PageAttribute.KEY, element.getAttribute(PageAttribute.KEY)); deprecationDesc = processorSet.process( element.getAttribute(DeprecationDescriptionAttribute.KEY).deprecationDescription(), ResolvedLocation.create(element.getLocation()), element);
element.getFile().putAttribute(PageAttribute.KEY, element.getAttribute(PageAttribute.KEY)); deprecationDesc = processorSet.process( element.getAttribute(DeprecationDescriptionAttribute.KEY).deprecationDescription(), ResolvedLocation.create(element.getLocation()), element);