本文整理汇总了Java中org.pentaho.di.core.util.StringUtil.getUsedVariables方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.getUsedVariables方法的具体用法?Java StringUtil.getUsedVariables怎么用?Java StringUtil.getUsedVariables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.getUsedVariables方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encryptPasswordIfNotUsingVariables
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
/**
* Encrypt the password, but only if the password doesn't contain any variables.
* @param password The password to encrypt
* @return The encrypted password or the
*/
public static final String encryptPasswordIfNotUsingVariables(String password)
{
String encrPassword = "";
List<String> varList = new ArrayList<String>();
StringUtil.getUsedVariables(password, varList, true);
if (varList.isEmpty())
{
encrPassword = PASSWORD_ENCRYPTED_PREFIX+Encr.encryptPassword(password);
}
else
{
encrPassword = password;
}
return encrPassword;
}
示例2: checkPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
private void checkPasswordVisible() {
String password = m_passText.getText();
ArrayList<String> list = new ArrayList<String>();
StringUtil.getUsedVariables(password, list, true);
if (list.size() == 0) {
m_passText.setEchoChar('*');
} else {
m_passText.setEchoChar('\0'); // show everything
}
}
示例3: getUsedVariables
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
public List<String> getUsedVariables() {
// Get the list of Strings.
List<StringSearchResult> stringList = getStringList(true, true, false);
List<String> varList = new ArrayList<String>();
// Look around in the strings, see what we find...
for (StringSearchResult result : stringList) {
StringUtil.getUsedVariables(result.getString(), varList, false);
}
return varList;
}
示例4: checkPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
public void checkPasswordVisible()
{
String password = wPassword.getText();
List<String> list = new ArrayList<String>();
StringUtil.getUsedVariables(password, list, true);
if (list.size() == 0)
wPassword.setEchoChar('*');
else
wPassword.setEchoChar('\0'); // Show it all...
}
示例5: checkPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
public void checkPasswordVisible()
{
String password = wPassword.getText();
java.util.List<String> list = new ArrayList<String>();
StringUtil.getUsedVariables(password, list, true);
if (list.isEmpty())
{
wPassword.setEchoChar('*');
}
else
{
wPassword.setEchoChar('\0'); // Show it all...
}
}
示例6: checkPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
public void checkPasswordVisible()
{
String password = wPassword.getText();
List<String> list = new ArrayList<String>();
StringUtil.getUsedVariables(password, list, true);
if (list.size() == 0)
{
wPassword.setEchoChar('*');
}
else
{
wPassword.setEchoChar('\0'); // Show it all...
}
}
示例7: checkProxyPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
public void checkProxyPasswordVisible()
{
String password = wProxyPassword.getText();
List<String> list = new ArrayList<String>();
StringUtil.getUsedVariables(password, list, true);
if (list.size() == 0)
{
wProxyPassword.setEchoChar('*');
}
else
{
wProxyPassword.setEchoChar('\0'); // Show it all...
}
}
示例8: checkSocksProxyPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
public void checkSocksProxyPasswordVisible()
{
String password = wSocksProxyPassword.getText();
List<String> list = new ArrayList<String>();
StringUtil.getUsedVariables(password, list, true);
if (list.size() == 0)
{
wSocksProxyPassword.setEchoChar('*');
}
else
{
wSocksProxyPassword.setEchoChar('\0'); // Show it all...
}
}
示例9: checkPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
/**
* Checks the password visible.
*/
private void checkPasswordVisible() {
final String password = wPasswordField.getText();
final List<String> list = new ArrayList<String>();
StringUtil.getUsedVariables(password, list, true);
if (list.size() == 0) {
wPasswordField.setEchoChar('*');
} else {
String variableName = null;
if (password.startsWith(StringUtil.UNIX_OPEN)
&& password.endsWith(StringUtil.UNIX_CLOSE)) {
variableName = password.substring(
StringUtil.UNIX_OPEN.length(), password.length()
- StringUtil.UNIX_CLOSE.length());
}
if (password.startsWith(StringUtil.WINDOWS_OPEN)
&& password.endsWith(StringUtil.WINDOWS_CLOSE)) {
variableName = password.substring(
StringUtil.WINDOWS_OPEN.length(), password.length()
- StringUtil.WINDOWS_CLOSE.length());
}
if (variableName != null
&& System.getProperty(variableName) != null) {
wPasswordField.setEchoChar('\0');
} else {
wPasswordField.setEchoChar('*');
}
}
}
示例10: getUsedVariables
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
/**
* Gets the used variables.
*
* @return the used variables
*/
public List<String> getUsedVariables() {
// Get the list of Strings.
List<StringSearchResult> stringList = getStringList(true, true, false);
List<String> varList = new ArrayList<String>();
// Look around in the strings, see what we find...
for (StringSearchResult result : stringList) {
StringUtil.getUsedVariables(result.getString(), varList, false);
}
return varList;
}
示例11: checkPasswordVisible
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
public static final void checkPasswordVisible( Text wPassword ) {
String password = wPassword.getText();
java.util.List<String> list = new ArrayList<String>();
StringUtil.getUsedVariables( password, list, true );
// ONLY show the variable in clear text if there is ONE variable used
// Also, it has to be the only string in the field.
//
if ( list.size() != 1 ) {
wPassword.setEchoChar( '*' );
} else {
String variableName = null;
if ( ( password.startsWith( StringUtil.UNIX_OPEN ) && password.endsWith( StringUtil.UNIX_CLOSE ) ) ) {
// ${VAR}
// 012345
//
variableName =
password.substring( StringUtil.UNIX_OPEN.length(), password.length() - StringUtil.UNIX_CLOSE.length() );
}
if ( ( password.startsWith( StringUtil.WINDOWS_OPEN ) && password.endsWith( StringUtil.WINDOWS_CLOSE ) ) ) {
// %VAR%
// 01234
//
variableName =
password.substring( StringUtil.WINDOWS_OPEN.length(), password.length()
- StringUtil.WINDOWS_CLOSE.length() );
}
// If there is a variable name in there AND if it's defined in the system properties...
// Otherwise, we'll leave it alone.
//
if ( variableName != null && System.getProperty( variableName ) != null ) {
wPassword.setEchoChar( '\0' ); // Show it all...
} else {
wPassword.setEchoChar( '*' );
}
}
}
示例12: containsVariables
import org.pentaho.di.core.util.StringUtil; //导入方法依赖的package包/类
private static boolean containsVariables( String entryPath ) {
List<String> variablesList = new ArrayList<String>();
StringUtil.getUsedVariables( entryPath, variablesList, true );
return !variablesList.isEmpty();
}