/** * @since 1.8 * @see DecorationUtils#getCustomChild */ public Object getCustomChild( String path ) { return DecorationUtils.getCustomChild( (org.codehaus.plexus.util.xml.Xpp3Dom) custom, path ); }
/** * @since 1.8 * @see DecorationUtils#getCustomValue */ public String getCustomValue( String path, String defaultValue ) { return DecorationUtils.getCustomValue( (org.codehaus.plexus.util.xml.Xpp3Dom) custom, path, defaultValue ); }
/** * @since 1.7 * @see DecorationUtils#isLink */ public boolean isLink( String href ) { return DecorationUtils.isLink( href ); }
public static boolean startsWithAnyIgnoreCase( String string, String... searchStrings ) { for ( int i = 0; i < searchStrings.length; i++ ) { String searchString = searchStrings[i]; if ( startsWithIgnoreCase( string, searchString ) ) { return true; } } return false; }
public static boolean isLink( String href ) { return StringUtils.isNotBlank( href ) && ( startsWithAnyIgnoreCase( href, "http:/", "https:/", "ftp:/", "mailto:", "file:/" ) || href.contains( "://" ) ); }
/** * Helper to get decoration custom DOM element value by simply specifying a dotted path. * * @param custom the custom DOM element * @param path the dotted path to the child * @return the element value or <code>null</code> if any element in the path does not exist * @since 1.8 */ public static String getCustomValue( Xpp3Dom custom, String path ) { custom = getCustomChild( custom, path ); return ( custom == null ) ? null : custom.getValue(); }
/** * @since 1.8 * @see DecorationUtils#getCustomValue */ public String getCustomValue( String path ) { return DecorationUtils.getCustomValue( (org.codehaus.plexus.util.xml.Xpp3Dom) custom, path ); }
/** * Helper to get decoration custom DOM element value by simply specifying a dotted path. * * @param custom the custom DOM element * @param path the dotted path to the child * @param defaultValue default value * @return the element value or the default value if any element in the path does not exist * @since 1.8 */ public static String getCustomValue( Xpp3Dom custom, String path, String defaultValue ) { custom = getCustomChild( custom, path ); return ( custom == null ) ? defaultValue : custom.getValue(); } }