@CliOptionVisibilityIndicator(command = "field embedded", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldEmbedded(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
result = lastUsed.getModule(); if (result == null) { throw new IllegalStateException( lastUsed.setTypeNotVerified(null, result);
public JavaPackage convertFromText(String value, final Class<?> requiredType, final String optionContext) { if (StringUtils.isBlank(value)) { return null; } Pom module = projectOperations.getFocusedModule(); if (value.contains(MODULE_PATH_SEPARATOR)) { final String moduleName = value.substring(0, value.indexOf(MODULE_PATH_SEPARATOR)); module = projectOperations.getPomFromModuleName(moduleName); value = value.substring(value.indexOf(MODULE_PATH_SEPARATOR) + 1, value.length()).trim(); if (StringUtils.contains(optionContext, UPDATE)) { projectOperations.setModule(module); } } String moduleName = module == null ? null : module.getModuleName(); JavaPackage result = new JavaPackage(convertToFullyQualifiedPackageName(module, value), moduleName); if (optionContext != null && (optionContext.contains(UPDATE) || optionContext.contains(UPDATELAST))) { lastUsed.setPackage(result, module); } return result; }
final JavaType result = lastUsed.getJavaType(); if (result == null) { throw new IllegalStateException( (lastUsed.getJavaPackage() == null ? lastUsed.getTopLevelPackage() .getFullyQualifiedPackageName() : lastUsed.getJavaPackage() .getFullyQualifiedPackageName()) + "." + newValue; lastUsed.setTypeNotVerified(null, module); } else { lastUsed.setTypeNotVerified(result, module);
private String locateNew(final String value, final String topLevelPath) { String newValue = value; if (value.startsWith(TOP_LEVEL_PACKAGE_SYMBOL)) { if (value.length() > 1) { newValue = (value.charAt(1) == '.' ? topLevelPath : topLevelPath + ".") + value.substring(1); } else { newValue = topLevelPath + "."; } } lastUsed.setTopLevelPackage(new JavaPackage(topLevelPath)); return newValue; }
lastUsed.setTopLevelPackage(new JavaPackage(topLevelPath)); return newValue;
@CliOptionVisibilityIndicator(command = "field enum", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldEnum(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionVisibilityIndicator(command = "field number", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldNumber(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionMandatoryIndicator(command = "field number", params = {"class"}) public boolean isClassMandatoryForFieldNumber() { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionMandatoryIndicator(command = "field boolean", params = {"class"}) public boolean isClassMandatoryForFieldBoolean() { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionMandatoryIndicator(command = "field date", params = {"class"}) public boolean isClassMandatoryForFieldDate() { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionMandatoryIndicator(command = "field embedded", params = {"class"}) public boolean isClassMandatoryForFieldEmbedded() { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionMandatoryIndicator(command = "field enum", params = {"class"}) public boolean isClassMandatoryForFieldEnum() { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionVisibilityIndicator(command = "field set", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldSet(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionVisibilityIndicator(command = "field string", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldString(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionVisibilityIndicator(command = "field date", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldDate(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionVisibilityIndicator(command = "field list", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldList(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionMandatoryIndicator(command = "field list", params = {"class"}) public boolean isClassMandatoryForFieldList() { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionVisibilityIndicator(command = "field boolean", params = {"class"}, help = "Option 'class' is not available " + "for this command when the focus is set to one class.") public boolean isClassVisibleForFieldBoolean(ShellContext shellContext) { if (lastUsed.getJavaType() == null) { return true; } return false; }
@CliOptionMandatoryIndicator(command = "field set", params = {"class"}) public boolean isClassMandatoryForFieldSet() { if (lastUsed.getJavaType() == null) { return true; } return false; }