@Override public String toString() { return new StringBuilder(path).append('.').append(type.name().toLowerCase()).toString(); }
@Override public String toString() { return new StringBuilder(path).append('.').append(type.name().toLowerCase()).toString(); }
/** * This method must be called from process(..) yourself! This is NOT automatically called to determine if process(..) will be called. * * @param type the ClientLibrary Type * @return true to accept this LibraryType, false to reject. */ @Override public boolean handles(@Nonnull LibraryType type) { // Note this method must be called from process(..) yourself! This is NOT automatically called to determine if process(..) will be called. // Determine if process(..) should be called for this library; The LibraryType in question is passed to make this determination. // https://docs.adobe.com/docs/en/aem/6-3/develop/ref/javadoc/com/adobe/granite/ui/clientlibs/LibraryType.html if (LibraryType.CSS.name().equals(type.name())) { // Compares is the Types are the same // > For CSS this is: CSS // > For JavaScript this is: JS return true; } else if (LibraryType.CSS.contentType.equals(type.contentType)) { // Most often, the Content Type (CSS or JS) is checked. // > For CSS this is: text/css // > For JavaScript this is: application/javascript return true; } else if (LibraryType.CSS.extension.equals(type.extension)) { // Occasionally the extension can be checked. // > For CSS this is: .css // > For JavaScript this is: .js return true; } return false; }