当前位置: 首页>>代码示例>>Java>>正文


Java Item.recycle方法代码示例

本文整理汇总了Java中lotus.domino.Item.recycle方法的典型用法代码示例。如果您正苦于以下问题:Java Item.recycle方法的具体用法?Java Item.recycle怎么用?Java Item.recycle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lotus.domino.Item的用法示例。


在下文中一共展示了Item.recycle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processJava2Domino

import lotus.domino.Item; //导入方法依赖的package包/类
public String[][] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	String[][] strRC = new String[2][];
	try {
		String[] strOldValues = getRawValueFromStore(docCurrent, def.getNotesField());
		String[] strValues = getValue(objCurrent, def.getJavaField());
		strRC[0] = strOldValues;
		strRC[1] = strValues;
		Vector<String> vecValues = new Vector<String>(strValues.length);

		boolean isNamesValue = false;
		if (def.isAuthor() || def.isReader() || def.isNames()) {
			Item iNotesField = docCurrent.replaceItemValue(def.getNotesField(), "");
			isNamesValue = NamesProcessor.getInstance().setNamesField(def, iNotesField);
			iNotesField.recycle();
		}

		for (String strVal : strValues) {
			vecValues.addElement(NamesProcessor.getInstance().setPerson(strVal, isNamesValue, docCurrent.getParentDatabase().getParent()));
		}
		strRC[1] = vecValues.toArray(new String[vecValues.size()]);
		Item notesItem =docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return strRC;

}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:31,代码来源:StringArrayBinder.java

示例2: processJava2Domino

import lotus.domino.Item; //导入方法依赖的package包/类
@Override
public List<Integer>[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	@SuppressWarnings("unchecked")
	List<Integer>[] lstRC = new List[2];
	try {
		List<Integer> lstOldValues = getValueFromStore(docCurrent, docCurrent.getItemValue(def.getNotesField()), def);
		List<Integer> lstValues = getValue(objCurrent, def.getJavaField());

		lstRC[0] = lstOldValues;
		lstRC[1] = lstValues;
		Vector<Integer> vecValues = new Vector<Integer>();
		vecValues.addAll(lstValues);
		Item notesItem = docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return lstRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:22,代码来源:ListIntegerBinder.java

示例3: processJava2Domino

import lotus.domino.Item; //导入方法依赖的package包/类
public Double[][] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	Double[][] dblRC = new Double[2][];
	try {
		Double[] nOldValues = getValueFromStore(docCurrent, docCurrent.getItemValue(def.getNotesField()), def);
		Double[] nValues = getValue(objCurrent, def.getJavaField());
		dblRC[0] = nOldValues;
		dblRC[1] = nValues;
		Vector<Double> vecValues = new Vector<Double>(nValues.length);
		for (Double nVal : nValues) {
			vecValues.addElement(nVal);
		}
		Item notesItem = docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return dblRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:21,代码来源:DoubleArrayBinder.java

示例4: processJava2Domino

import lotus.domino.Item; //导入方法依赖的package包/类
public String[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	String[] arrRC = new String[2];
	try {
		boolean isNamesValue = false;
		String strOldValue = docCurrent.getItemValueString(def.getNotesField());
		String strValue = getValue(objCurrent, def.getJavaField());
		if (strValue == null) {
			strValue = "";
		}
		if (def.isAuthor() || def.isReader() || def.isNames()) {
			Item iNotesField = docCurrent.replaceItemValue(def.getNotesField(), "");
			isNamesValue = NamesProcessor.getInstance().setNamesField(def, iNotesField);
			strValue = NamesProcessor.getInstance().setPerson(strValue, isNamesValue, docCurrent.getParentDatabase().getParent());
			iNotesField.recycle();
		}
		arrRC[0] = strOldValue;
		arrRC[1] = strValue;
		Item notesItem = docCurrent.replaceItemValue(def.getNotesField(), strValue);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return arrRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:27,代码来源:StringBinder.java

示例5: processJava2Domino

import lotus.domino.Item; //导入方法依赖的package包/类
@Override
public List<Double>[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	@SuppressWarnings("unchecked")
	List<Double>[] lstRC = new List[2];
	try {
		List<Double> lstOldValues = getValueFromStore(docCurrent, docCurrent.getItemValue(def.getNotesField()), def);
		List<Double> lstValues = getValue(objCurrent, def.getJavaField());

		lstRC[0] = lstOldValues;
		lstRC[1] = lstValues;
		Vector<Double> vecValues = new Vector<Double>();
		vecValues.addAll(lstValues);
		Item notesItem =docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return lstRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:22,代码来源:ListDoubleBinder.java

示例6: loadProps

import lotus.domino.Item; //导入方法依赖的package包/类
public static Properties loadProps(Document doc, String fieldName){
	Properties props=new Properties();
	InputStream in = null;
	Item item = null;
	try{
		
		if(doc==null) return props;
		
		//make sure the field is multi-value, 
		//and uses new lines between each value.
		item = doc.getFirstItem(fieldName);
		if(item==null){
			return props;
		}
		String data = item.getText().replace(';','\n');
		in = new ByteArrayInputStream(data.getBytes());
		props.load(in);
		item.recycle();

	}catch(Exception e){
		//replace with your own logger.
		logger.log(Level.SEVERE,null,e);

	}finally{
		IOUtils.closeQuietly(in);
	}
	return props;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:29,代码来源:XSPUtils.java

示例7: processJava2Domino

import lotus.domino.Item; //导入方法依赖的package包/类
public List<String>[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	@SuppressWarnings("unchecked")
	List<String>[] lstRC = new List[2];
	try {
		List<String> lstOldValues = getRawValueFromStore(docCurrent, def.getNotesField());
		List<String> lstValues = getValue(objCurrent, def.getJavaField());

		lstRC[0] = lstOldValues;
		lstRC[1] = lstValues;
		Vector<String> vValues = new Vector<String>();

		if (lstValues != null) {
			boolean isNamesValue = false;
			if (def.isAuthor() || def.isReader() || def.isNames()) {
				Item iNotesField = docCurrent.replaceItemValue(def.getNotesField(), "");
				isNamesValue = NamesProcessor.getInstance().setNamesField(def, iNotesField);
				iNotesField.recycle();
			}

			for (String strValue : lstValues) {
				vValues.add(NamesProcessor.getInstance().setPerson(strValue, isNamesValue, docCurrent.getParentDatabase().getParent()));
			}
			lstRC[1] = new ArrayList<String>(vValues);

		}
		Item notesItem =docCurrent.replaceItemValue(def.getNotesField(), vValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return lstRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:35,代码来源:ListStringBinder.java

示例8: checkLoad

import lotus.domino.Item; //导入方法依赖的package包/类
public void checkLoad() {
	if (m_Content != null) {
		return;
	}
	try {
		Database ndbCurrent = NotesContext.getCurrentUnchecked().getCurrentSession().getDatabase(m_Server, m_Database);
		if (ndbCurrent == null) {
			throw new XPTRuntimeException("Database "+ m_Server +"!!"+m_Database +" not accessable");
		}
		Document docCurrent = ndbCurrent.getDocumentByUNID(m_DocumentUNID);
		if (docCurrent == null) {
			throw new XPTRuntimeException("Document "+ m_Server +"!!"+m_Database +"/"+ m_DocumentUNID+" not accessable");
			
		}
		MIMEEntity mimeCurrent = docCurrent.getMIMEEntity(m_FieldName);
		if (mimeCurrent == null && !docCurrent.hasItem(m_FieldName)) {
			m_Content = MimeMultipart.fromHTML("");
			return;
		}
		if (mimeCurrent == null && docCurrent.hasItem(m_FieldName)) {
			if (docCurrent.getFirstItem(m_FieldName) != null) {
				Item itField = docCurrent.getFirstItem(m_FieldName);
				if (itField.getType() != 1) {
					m_Content = MimeMultipart.fromHTML(docCurrent.getItemValueString(m_FieldName));
				} else {
					RichTextItem rti = (RichTextItem) itField;
					if (rti != null) {
						DominoDocument dd = new DominoDocument();
						dd.setDocument(docCurrent);
						DominoRichTextItem drtCurrent = new DominoRichTextItem(dd, rti);
						m_Content = MimeMultipart.fromHTML(drtCurrent.getHTML());
					}
				}
				itField.recycle();
			}
			docCurrent.recycle();
			ndbCurrent.recycle();
		}
		processMime(mimeCurrent);
	} catch (Exception ex) {
		LoggerFactory.logError(this.getClass(), "Error druing checkLoad()", ex);
		throw new XPTRuntimeException("General Error with: Database "+ m_Server +"!!"+m_Database +" / Field: "+ m_FieldName +" / "+m_DocumentUNID);
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:45,代码来源:MimeMultiPartExtended.java

示例9: run1

import lotus.domino.Item; //导入方法依赖的package包/类
public void run1(final Session session) throws NotesException {
	Long sessId = getLotusId(session);
	sessionid.set(sessId);
	Database db = session.getDatabase("", "names.nsf");
	System.out.println("Db id:" + getLotusId(db));
	Name name = null;
	int i = 0;
	try {
		for (i = 0; i <= 100000; i++) {
			name = session.createName(UUID.randomUUID().toString());
			getLotusId(name);
			DateTime dt = session.createDateTime(new Date());
			getLotusId(dt);
			DateTime end = session.createDateTime(new Date());
			getLotusId(end);
			DateRange dr = session.createDateRange(dt, end);
			getLotusId(dr);
			Document doc = db.createDocument();
			getLotusId(doc);
			Item i1 = doc.replaceItemValue("Foo", dr);
			getLotusId(i1);
			Item i2 = doc.replaceItemValue("Bar", dr.getText());
			getLotusId(i2);
			Item i3 = doc.replaceItemValue("Blah", dr.getStartDateTime().getLocalTime());
			getLotusId(i3);
			lotus.domino.ColorObject color = session.createColorObject();
			getLotusId(color);
			color.setRGB(128, 128, 128);
			Item i4 = doc.replaceItemValue("color", color.getNotesColor());
			getLotusId(i4);
			i1.recycle();
			i2.recycle();
			i3.recycle();
			i4.recycle();
			DateTime create = doc.getCreated();
			getLotusId(create);
			@SuppressWarnings("unused")
			String lc = create.getLocalTime();
			//					if (i % 10000 == 0) {
			//						System.out.println(Thread.currentThread().getName() + " Name " + i + " is " + name.getCommon() + " "
			//								+ "Local time is " + lc + "  " + dr.getText());
			//					}
			dr.recycle();
			doc.recycle();
			dt.recycle();
			end.recycle();
			create.recycle();
			color.recycle();
			name.recycle();
		}
	} catch (Throwable t) {
		t.printStackTrace();
		System.out.println("Exception at loop point " + i);
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:56,代码来源:NotesRunner.java


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