public static String notNullOrWhitespace(final String value, final String parameterName) { if (!StringUtilities.isNullOrWhitespace(value)) { return value; } throw new IllegalArgumentException( format("Argument '%s' must be a non-null, non-empty string.", parameterName) ); }
public static String notNullOrWhitespace(final String value, final String parameterName) { if (!StringUtilities.isNullOrWhitespace(value)) { return value; } throw new IllegalArgumentException( format("Argument '%s' must be a non-null, non-empty string.", parameterName) ); }
public static String notNullOrWhitespace(final String value, final String parameterName) { if (!StringUtilities.isNullOrWhitespace(value)) { return value; } throw new IllegalArgumentException( format("Argument '%s' must be a non-null, non-empty string.", parameterName) ); }
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public static String getMessage(final Throwable t) { final String message = VerifyArgument.notNull(t, "t").getMessage(); if (StringUtilities.isNullOrWhitespace(message)) { return t.getClass().getSimpleName() + " was thrown."; } return message; }
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public static String getMessage(final Throwable t) { final String message = VerifyArgument.notNull(t, "t").getMessage(); if (StringUtilities.isNullOrWhitespace(message)) { return t.getClass().getSimpleName() + " was thrown."; } return message; }
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") public static String getMessage(final Throwable t) { final String message = VerifyArgument.notNull(t, "t").getMessage(); if (StringUtilities.isNullOrWhitespace(message)) { return t.getClass().getSimpleName() + " was thrown."; } return message; }
public static boolean isTrue(final String value) { if (isNullOrWhitespace(value)) { return false; } final String trimmedValue = value.trim(); if (trimmedValue.length() == 1) { final char ch = Character.toLowerCase(trimmedValue.charAt(0)); return ch == 't' || ch == 'y' || ch == '1'; } return StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "true") || StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "yes"); }
public static boolean isFalse(final String value) { if (isNullOrWhitespace(value)) { return false; } final String trimmedValue = value.trim(); if (trimmedValue.length() == 1) { final char ch = Character.toLowerCase(trimmedValue.charAt(0)); return ch == 'f' || ch == 'n' || ch == '0'; } return StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "false") || StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "no"); }
public static boolean isTrue(final String value) { if (isNullOrWhitespace(value)) { return false; } final String trimmedValue = value.trim(); if (trimmedValue.length() == 1) { final char ch = Character.toLowerCase(trimmedValue.charAt(0)); return ch == 't' || ch == 'y' || ch == '1'; } return StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "true") || StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "yes"); }
public static boolean isTrue(final String value) { if (isNullOrWhitespace(value)) { return false; } final String trimmedValue = value.trim(); if (trimmedValue.length() == 1) { final char ch = Character.toLowerCase(trimmedValue.charAt(0)); return ch == 't' || ch == 'y' || ch == '1'; } return StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "true") || StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "yes"); }
public static boolean isFalse(final String value) { if (isNullOrWhitespace(value)) { return false; } final String trimmedValue = value.trim(); if (trimmedValue.length() == 1) { final char ch = Character.toLowerCase(trimmedValue.charAt(0)); return ch == 'f' || ch == 'n' || ch == '0'; } return StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "false") || StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "no"); }
public static boolean isFalse(final String value) { if (isNullOrWhitespace(value)) { return false; } final String trimmedValue = value.trim(); if (trimmedValue.length() == 1) { final char ch = Character.toLowerCase(trimmedValue.charAt(0)); return ch == 'f' || ch == 'n' || ch == '0'; } return StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "false") || StringComparator.OrdinalIgnoreCase.equals(trimmedValue, "no"); }
public final void addType(final TypeDefinition type) { final TypeDeclaration astType = createType(type); final String packageName = type.getPackageName(); if (_compileUnit.getPackage().isNull() && !StringUtilities.isNullOrWhitespace(packageName)) { _compileUnit.insertChildBefore( _packagePlaceholder, new PackageDeclaration(packageName), Roles.PACKAGE ); _packagePlaceholder.remove(); } _compileUnit.addChild(astType, CompilationUnit.TYPE_ROLE); }
public final void addType(final TypeDefinition type) { final TypeDeclaration astType = createType(type); final String packageName = type.getPackageName(); if (_compileUnit.getPackage().isNull() && !StringUtilities.isNullOrWhitespace(packageName)) { _compileUnit.insertChildBefore( _packagePlaceholder, new PackageDeclaration(packageName), Roles.PACKAGE ); _packagePlaceholder.remove(); } _compileUnit.addChild(astType, CompilationUnit.MEMBER_ROLE); }
public final void addType(final TypeDefinition type) { final TypeDeclaration astType = createType(type); final String packageName = type.getPackageName(); if (_compileUnit.getPackage().isNull() && !StringUtilities.isNullOrWhitespace(packageName)) { _compileUnit.insertChildBefore( _packagePlaceholder, new PackageDeclaration(packageName), Roles.PACKAGE ); _packagePlaceholder.remove(); } _compileUnit.addChild(astType, CompilationUnit.MEMBER_ROLE); }
public TypeInfo getTypeInfo(final Type<?> type) { final Utf8StringConstant name = getUtf8StringConstant(type.getInternalName()); if (type.isNested()) { referencedInnerTypes.add(type); final Type declaringType = type.getDeclaringType(); final MethodBase declaringMethod = type.getDeclaringMethod(); final String shortName = type.getShortName(); if (declaringType != null) { getTypeInfo(declaringType); } if (declaringMethod != null) { getMethodReference(declaringMethod); } if (!StringUtilities.isNullOrWhitespace(shortName)) { getUtf8StringConstant(shortName); } } _lookupKey.set(Tag.TypeInfo, name.index); Entry entry = _entryMap.get(_lookupKey); if (entry == null) { entry = new TypeInfo(this, name.index); } _lookupKey.clear(); return (TypeInfo)entry; }
public TypeInfo getTypeInfo(final Type<?> type) { final Utf8StringConstant name = getUtf8StringConstant(type.getInternalName()); if (type.isNested()) { referencedInnerTypes.add(type); final Type declaringType = type.getDeclaringType(); final MethodBase declaringMethod = type.getDeclaringMethod(); final String shortName = type.getShortName(); if (declaringType != null) { getTypeInfo(declaringType); } if (declaringMethod != null) { getMethodReference(declaringMethod); } if (!StringUtilities.isNullOrWhitespace(shortName)) { getUtf8StringConstant(shortName); } } _lookupKey.set(Tag.TypeInfo, name.index); Entry entry = _entryMap.get(_lookupKey); if (entry == null) { entry = new TypeInfo(this, name.index); } _lookupKey.clear(); return (TypeInfo)entry; }
public AstBuilder(final DecompilerContext context) { _context = VerifyArgument.notNull(context, "context"); final String headerText = context.getSettings().getOutputFileHeaderText(); if (!StringUtilities.isNullOrWhitespace(headerText)) { final List<String> lines = StringUtilities.split(headerText, false, '\n'); for (final String line : lines) { _compileUnit.addChild(new Comment(" " + line.trim(), CommentType.SingleLine), Roles.COMMENT); } _compileUnit.addChild(new UnixNewLine(), Roles.NEW_LINE); } _packagePlaceholder = new TextNode(); _compileUnit.addChild(_packagePlaceholder, Roles.TEXT); if (_context.getUserData(Keys.AST_BUILDER) == null) { _context.putUserData(Keys.AST_BUILDER, this); } }
public AstBuilder(final DecompilerContext context) { _context = VerifyArgument.notNull(context, "context"); final String headerText = context.getSettings().getOutputFileHeaderText(); if (!StringUtilities.isNullOrWhitespace(headerText)) { final List<String> lines = StringUtilities.split(headerText, false, '\n'); for (final String line : lines) { _compileUnit.addChild(new Comment(" " + line.trim(), CommentType.SingleLine), Roles.COMMENT); } _compileUnit.addChild(new UnixNewLine(), Roles.NEW_LINE); } _packagePlaceholder = new TextNode(); _compileUnit.addChild(_packagePlaceholder, Roles.TEXT); if (_context.getUserData(Keys.AST_BUILDER) == null) { _context.putUserData(Keys.AST_BUILDER, this); } }
public AstBuilder(final DecompilerContext context) { _context = VerifyArgument.notNull(context, "context"); final String headerText = context.getSettings().getOutputFileHeaderText(); if (!StringUtilities.isNullOrWhitespace(headerText)) { final List<String> lines = StringUtilities.split(headerText, false, '\n'); for (final String line : lines) { _compileUnit.addChild(new Comment(" " + line.trim(), CommentType.SingleLine), Roles.COMMENT); } _compileUnit.addChild(new UnixNewLine(), Roles.NEW_LINE); } _packagePlaceholder = new TextNode(); _compileUnit.addChild(_packagePlaceholder, Roles.TEXT); if (_context.getUserData(Keys.AST_BUILDER) == null) { _context.putUserData(Keys.AST_BUILDER, this); } }