本文整理匯總了Java中org.teiid.core.util.StringUtil.valueOf方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtil.valueOf方法的具體用法?Java StringUtil.valueOf怎麽用?Java StringUtil.valueOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.teiid.core.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.valueOf方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: TransformationMetadata
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
/**
* TransformationMetadata constructor
* @param context Object containing the info needed to lookup metadta.
*/
public TransformationMetadata(VDBMetaData vdbMetadata, final CompositeMetadataStore store, Map<String, VDBResources.Resource> vdbEntries, FunctionTree systemFunctions, Collection<FunctionTree> functionTrees) {
ArgCheck.isNotNull(store);
this.vdbMetaData = vdbMetadata;
if (this.vdbMetaData !=null) {
this.scriptEngineManager = vdbMetadata.getAttachment(ScriptEngineManager.class);
this.importedModels = this.vdbMetaData.getImportedModels();
this.allowedLanguages = StringUtil.valueOf(vdbMetadata.getPropertyValue(ALLOWED_LANGUAGES), Set.class);
if (this.allowedLanguages == null) {
this.allowedLanguages = Collections.emptySet();
}
for (DataPolicyMetadata policy : vdbMetadata.getDataPolicyMap().values()) {
policy = policy.clone();
policies.put(policy.getName(), policy);
}
store.processGrants(policies);
} else {
this.importedModels = Collections.emptySet();
}
this.store = store;
if (vdbEntries == null) {
this.vdbEntries = Collections.emptyMap();
} else {
this.vdbEntries = vdbEntries;
}
if (functionTrees == null) {
this.functionLibrary = new FunctionLibrary(systemFunctions);
} else {
this.functionLibrary = new FunctionLibrary(systemFunctions, functionTrees.toArray(new FunctionTree[functionTrees.size()]));
}
}
示例2: convert
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
private static Object convert(Object value, Class<?> type) {
if(value.getClass() == type) {
return value;
}
if (value instanceof String) {
String str = (String)value;
return StringUtil.valueOf(str, type);
}
return value;
}
示例3: createConnectionFactory
import org.teiid.core.util.StringUtil; //導入方法依賴的package包/類
@Override
@SuppressWarnings("serial")
public BasicConnectionFactory<FileConnectionImpl> createConnectionFactory() throws ResourceException {
if (this.parentDirectory == null) {
throw new InvalidPropertyException(UTIL.getString("parentdirectory_not_set")); //$NON-NLS-1$
}
final Map<String, String> map = StringUtil.valueOf(this.fileMapping, Map.class);
return new BasicConnectionFactory<FileConnectionImpl>() {
@Override
public FileConnectionImpl getConnection() throws ResourceException {
return new FileConnectionImpl(parentDirectory, map, allowParentPaths);
}
};
}