• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Values类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.wm.util.Values的典型用法代码示例。如果您正苦于以下问题:Java Values类的具体用法?Java Values怎么用?Java Values使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Values类属于com.wm.util包,在下文中一共展示了Values类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: idataFromClasspathResource

import com.wm.util.Values; //导入依赖的package包/类
protected IData idataFromClasspathResource(String fileName) throws Exception {
	InputStreamReader isr = new InputStreamReader(streamFromClasspathResource(fileName));
	char [] buf = new char[100];
	int len = isr.read(buf);
	boolean isIData = new String(buf,0,len).contains("IData");
	if (isIData) {
		return new IDataXMLCoder().decode(streamFromClasspathResource(fileName));
	} else {
		Document node = new com.wm.lang.xml.Document(streamFromClasspathResource(fileName), null, "UTF-8", false, null, true);
		Values in = new Values();
		DocumentToRecordService dtrs = new DocumentToRecordService(in, false);
		dtrs.setIsXTD(true);
		IData idata = (IData) dtrs.bind(node);
		IDataCursor cursor = idata.getCursor();
		IDataUtil.remove(cursor , "@version"); // Inserted during conversion
		cursor.destroy();
		return idata;
	}
}
 
开发者ID:wmaop,项目名称:wm-jbehave,代码行数:20,代码来源:BaseServiceStep.java


示例2: getInputValues

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Reads input for service invocation. Turns properly formatted input into an instance of Values
 * suitable for service invocation. Called before service invocation to provide input.
 *
 * @param inputStream  The input stream from which to read.
 * @param invokeState  The current invocation state (such as the current user).
 * @return             The prepared service invocation input pipeline.
 * @throws IOException If an error occurs reading from the input stream.
 */
@Override
public Values getInputValues(InputStream inputStream, InvokeState invokeState) throws IOException {
    ContentHandlerInput contentHandlerInput = new ContentHandlerInput(inputStream, invokeState, new Values());

    if (filters != null) {
        for (FilterContentHandler filter : filters) {
            filter.getInputValues(contentHandlerInput);
        }
    }

    Values values = super.getInputValues(contentHandlerInput.getInputStream(), contentHandlerInput.getInvokeState());
    contentHandlerInput.getValues().copyFrom(values);

    return contentHandlerInput.getValues();
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:25,代码来源:ChainedFilterContentHandler.java


示例3: getProperties

import com.wm.util.Values; //导入依赖的package包/类
public Values getProperties()
  {
      Values props = super.getProperties();
      props.put("factoryKey", getFactoryKey());
      props.put("configURL", ListenerAdmin.getFactory(getFactoryKey()).getConfigURL());
      props.put("provider", "Generic");
      
      props.put("plugin",plugin);
      //props.put("maxConn","10");
      
props.put("so_timeout",Integer.toString(so_timeout));
      props.put("service_name", service_name);
      
      
      return props;
  }
 
开发者ID:iandrosov,项目名称:SimpleSocket,代码行数:17,代码来源:SOCKETListener.java


示例4: SOCKETListener

import com.wm.util.Values; //导入依赖的package包/类
public SOCKETListener(Values properties)
  {
      super(properties);
      classid = "SOCKETListener";
 		int port = properties.getInt("port");
      if(port == -1)
          port = 4444;
      setPort(port);
      sockServer = null;
      setPackage(properties.getString("pkg"));
      setEnabled(properties.getBoolean("enabled"));
      
      // Set plugin
      plugin = properties.getString("plugin");
      
      // Set server socket timeout value
so_timeout = properties.getInt("so_timeout");
if (so_timeout == -1)
	so_timeout = 20000; // Set default timeout value to 20000 milliseconds

// Set service name to execute
service_name = properties.getString("service_name");

if (service_name == null )
	service_name = "SimpleSocket:receive"; // Default service name
  }
 
开发者ID:iandrosov,项目名称:SimpleSocket,代码行数:27,代码来源:SOCKETListener.java


示例5: createListener

import com.wm.util.Values; //导入依赖的package包/类
public ServerListenerIf createListener(Values props)
	throws ServerListenerException
{

       if(!props.containsKey("port"))
           throw new ServerListenerException(wm.server.net.resources.ServerListenerExceptionBundle.class, ServerListenerExceptionBundle.PORT_REQUIRED, "");

       int port = props.getInt("port");

       if(port == -1)
           throw new ServerListenerException(wm.server.net.resources.ServerListenerExceptionBundle.class, ServerListenerExceptionBundle.PORT_NUMBER_REQUIRED, "");

       if(port <= 0 || port > 65535)
       {
           JournalLogger.logError(1, 46, Integer.toString(port));
           throw new ServerListenerException(SimpleSocket.server.net.resources.ServerListenerExceptionBundle.class, ServerListenerExceptionBundle.INVALID_PORT, "");
       } else
       {
           return new SOCKETListener(props);
       }

}
 
开发者ID:iandrosov,项目名称:SimpleSocket,代码行数:23,代码来源:SOCKETListenerFactory.java


示例6: put_object_in_session

import com.wm.util.Values; //导入依赖的package包/类
public static final Values put_object_in_session (Values in)
   {
       Values out = in;
	// --- <<IS-START(put_object_in_session)>> ---
	// @sigtype java 3.0
	// [i] object:0:required object
	// [i] field:0:required objectName
Object obj = in.get("object");
String strObjectName = in.getString("objectName");
Session session = Service.getSession();

// Data type
Object tobj = session.get(strObjectName);
if (tobj != null)
	session.remove(strObjectName);

session.put(strObjectName, obj);
	// --- <<IS-END>> ---
       return out;
               
}
 
开发者ID:iandrosov,项目名称:SimpleToolBox,代码行数:22,代码来源:sys.java


示例7: testCustomDocFactory

import com.wm.util.Values; //导入依赖的package包/类
@Test
public void testCustomDocFactory() {
	final Values customIData =  new Values(new Object[][] {{"key1", "Hello!"}});
	
	GenericConversionService conversionService = new GenericConversionService();
	Converter<String, MyClass> converter = new Converter<String, MyClass>() {
		public MyClass convert(String source) {
			return new MyClass(source);
		};
	};
	conversionService.addConverter(String.class, MyClass.class, converter );
	DocumentFactoryBuilder docFactBuilder = new DocumentFactoryBuilder();
	docFactBuilder.setConversionService(conversionService);
	docFactBuilder.setDirectIDataFactory(new DirectIDataFactory() {
		
		@Override
		public IData create() {				
			return customIData;
		}
	});
	
	DocumentFactory docFact = docFactBuilder.build();
	Document document = docFact.create();
	
	// Confirm custom IData is the one that has been created
	assertSame(document.getIData(), customIData);
	
	// Confirm the conversion service we created is used
	assertEquals("Hello!", document.entry("key1", MyClass.class).getVal().getText());
	
}
 
开发者ID:innodev-au,项目名称:wmboost-data,代码行数:32,代码来源:DocumentFactoryBuilderTest.java


示例8: putOutputValues

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Encodes output of service invocation. Writes output data (including possibly error messages)
 * directly to the output stream.
 *
 * @param outputStream The output stream to which to write.
 * @param values       The output values to encode.
 * @param invokeState  The current invocation state (such as the current user).
 * @throws IOException If an error occurs writing to the output stream.
 */
@Override
public void putOutputValues(OutputStream outputStream, Values values, InvokeState invokeState) throws IOException {
    ContentHandlerOutput contentHandlerOutput = new ContentHandlerOutput(outputStream, values, invokeState);

    if (filters != null) {
        for (FilterContentHandler filter : filters) {
            filter.putOutputValues(contentHandlerOutput);
        }
    }

    super.putOutputValues(contentHandlerOutput.getOutputStream(), contentHandlerOutput.getValues(), contentHandlerOutput.getInvokeState());
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:22,代码来源:ChainedFilterContentHandler.java


示例9: shutdown

import com.wm.util.Values; //导入依赖的package包/类
public static Values shutdown(Values in)
	throws ServiceException
{
    Values out = in;
    try
    {
        ListenerAdmin.unregisterFactory("Generic/SOCKET");
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
    return out;
}
 
开发者ID:iandrosov,项目名称:SimpleSocket,代码行数:15,代码来源:socket.java


示例10: get_object_from_session

import com.wm.util.Values; //导入依赖的package包/类
public static final Values get_object_from_session (Values in)
   {
       Values out = in;
	// --- <<IS-START(get_object_from_session)>> ---
	// @sigtype java 3.0
	// [i] field:0:required objectName
	// [o] object:0:required object
String strObjectName = in.getString("objectName");
Session session = Service.getSession();
out.put("object", session.get(strObjectName));
	// --- <<IS-END>> ---
       return out;
               
}
 
开发者ID:iandrosov,项目名称:SimpleToolBox,代码行数:15,代码来源:sys.java


示例11: get_dir

import com.wm.util.Values; //导入依赖的package包/类
public static final void get_dir (IData pipeline)
       throws ServiceException
{
	// --- <<IS-START(get_dir)>> ---
	// @subtype unknown
	// @sigtype java 3.5
	// [o] field:0:required pkg_config
	// [o] field:1:required config_file_list
	IDataHashCursor idc = pipeline.getHashCursor();
	
		// Get input values
	   	idc.first();
		String key = idc.getKey();
		
		Values vl = ValuesEmulator.getValues(pipeline, key);
		String pkg = Service.getPackageName(vl);
		File fl = ServerAPI.getPackageConfigDir(pkg);
		String config_dir = fl.getPath();
	
		try
		{	
			// Get list of files in a give directory
	        File fname = new File(config_dir);
	        String[] file_list = fname.list();
			fname = null;
		   	idc.first();
			idc.insertAfter("config_file_list", file_list);
		}
		catch(Exception e)
		{
			throw new ServiceException(e.getMessage());
		}
	
		// Setup output message
		idc.first();
		idc.insertAfter("pkg_config",config_dir + File.separator);
	
		idc.destroy();
	// --- <<IS-END>> ---

               
}
 
开发者ID:iandrosov,项目名称:SimpleExcel,代码行数:43,代码来源:util.java


示例12: get_package_config_dir

import com.wm.util.Values; //导入依赖的package包/类
public static final void get_package_config_dir (IData pipeline)
       throws ServiceException
{
	// --- <<IS-START(get_package_config_dir)>> ---
	// @sigtype java 3.5
	// [o] field:0:required pkg_config
	// [o] field:1:required config_file_list
	IDataHashCursor idc = pipeline.getHashCursor();

// Get input values
  	idc.first();
String key = idc.getKey();

Values vl = ValuesEmulator.getValues(pipeline, key);
String pkg = Service.getPackageName(vl);
File fl = ServerAPI.getPackageConfigDir(pkg);
String config_dir = fl.getPath();

try
{	
	// Get list of files in a give directory
       File fname = new File(config_dir);
       String[] file_list = fname.list();
	fname = null;
   	idc.first();
	idc.insertAfter("config_file_list", file_list);
}
catch(Exception e)
{
	throw new ServiceException(e.getMessage());
}

// Setup output message
idc.first();
idc.insertAfter("pkg_config",config_dir);

idc.destroy();
	// --- <<IS-END>> ---

               
}
 
开发者ID:iandrosov,项目名称:SimpleToolBox,代码行数:42,代码来源:sys.java


示例13: removeCustomLog

import com.wm.util.Values; //导入依赖的package包/类
public static final void removeCustomLog (IData pipeline)
       throws ServiceException
{
	// --- <<IS-START(removeCustomLog)>> ---
	// @sigtype java 3.5
	IDataHashCursor idc = pipeline.getHashCursor();

// Get input values
  	idc.first();
String key = idc.getKey();

Values vl = ValuesEmulator.getValues(pipeline, key);
String pkg = Service.getPackageName(vl);
File fl = ServerAPI.getPackageConfigDir(pkg);
String config_path = fl.getPath();
String prop = config_path + File.separator + "clean.properties";

try
{	
	Properties config = new Properties();
	InputStream in_stream = (InputStream) new FileInputStream(prop);
	config.load(in_stream);
	String dir = config.getProperty("server.clean.dir");
	String mask = config.getProperty("server.clean.file");

	// Get list of files in a server logs directory
       File fname = new File(dir);
       String[] file_list = fname.list();
       String ff = "";
	String file_name = "";
	String tmp = "";

	// Find all files in a given location and return names and size
       for (int i = 0; i < file_list.length; i++)
       {
		file_name = file_list[i];
           ff = dir;
           ff += File.separator;
           ff += file_name;
		fname = null;
           fname = new File(ff);
		
           if (fname.isFile())
		{
			if (mask.equals(file_name))
				fname.delete();			
		}	
       }

	fname = null;
	config = null;
	in_stream = null;
}
catch(Exception e)
{
	throw new ServiceException(e.getMessage());
}
	// --- <<IS-END>> ---

               
}
 
开发者ID:iandrosov,项目名称:SimpleToolBox,代码行数:62,代码来源:clean.java


示例14: setValues

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Set the Values object this object wraps.
 *
 * @param values The Values object to be wrapped.
 */
@Override
public void setValues(Values values) {
    setIData(values);
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:10,代码来源:IDataAdapter.java


示例15: getValues

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Returns the Values object this object wraps.
 *
 * @return The Values object this object wraps.
 */
@Override
public Values getValues() {
    return Values.use(getIData());
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:10,代码来源:IDataAdapter.java


示例16: ContentHandlerOutput

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Constructs a new ContentHandlerOutput object.
 *
 * @param outputStream  The output stream the response is written to.
 * @param values        The values encoded in the response.
 * @param invokeState   The current invocation state.
 */
public ContentHandlerOutput(OutputStream outputStream, Values values, InvokeState invokeState) {
    this.outputStream = outputStream;
    this.values = values;
    this.invokeState = invokeState;
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:13,代码来源:ContentHandlerOutput.java


示例17: getValues

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Returns the values.
 *
 * @return The values.
 */
public Values getValues() {
    return values;
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:9,代码来源:ContentHandlerOutput.java


示例18: setValues

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Sets the stored values to be the given values.
 *
 * @param values    The new values.
 */
public void setValues(Values values) {
    this.values = values;
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:9,代码来源:ContentHandlerOutput.java


示例19: ContentHandlerInput

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Constructs a new ContentHandlerInput object.
 *
 * @param inputStream   The input stream.
 * @param invokeState   The current invocation state.
 * @param values        The resulting values.
 */
public ContentHandlerInput(InputStream inputStream, InvokeState invokeState, Values values) {
    this.inputStream = inputStream;
    this.invokeState = invokeState;
    this.values = values;
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:13,代码来源:ContentHandlerInput.java


示例20: setValues

import com.wm.util.Values; //导入依赖的package包/类
/**
 * Sets the stored values to be the given values.
 *
 * @param values        The new values.
 */
public void setValues(Values values) {
    this.values = values;
}
 
开发者ID:Permafrost,项目名称:Tundra.java,代码行数:9,代码来源:ContentHandlerInput.java



注:本文中的com.wm.util.Values类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TangoXyzIjData类代码示例发布时间:2022-05-22
下一篇:
Java ObjectCopierFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap