本文整理汇总了Java中org.compiere.model.PO.get_ValueAsString方法的典型用法代码示例。如果您正苦于以下问题:Java PO.get_ValueAsString方法的具体用法?Java PO.get_ValueAsString怎么用?Java PO.get_ValueAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.compiere.model.PO
的用法示例。
在下文中一共展示了PO.get_ValueAsString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deletePO
import org.compiere.model.PO; //导入方法依赖的package包/类
private void deletePO(PO po)
{
boolean doDelete = true;
if (po.get_ColumnIndex("EntityType") >= 0)
{
final String entityType = po.get_ValueAsString("EntityType");
doDelete = !EntityTypesCache.instance.isSystemMaintained(entityType);
}
if (doDelete)
{
deleteLog(po);
}
else
{
if (po instanceof I_AD_Field)
{
I_AD_Field field = (I_AD_Field)po;
field.setIsDisplayed(false);
}
po.setIsActive(false);
saveLog(po);
}
}
示例2: createMigrationStep
import org.compiere.model.PO; //导入方法依赖的package包/类
protected I_AD_MigrationStep createMigrationStep(final IMigrationLoggerContext migrationCtx, final PO contextPO)
{
String entityType = null;
final Properties ctx;
final String trxName;
if (contextPO != null)
{
final int idxEntityType = contextPO.get_ColumnIndex("EntityType");
if (idxEntityType >= 0)
{
entityType = contextPO.get_ValueAsString("EntityType");
}
ctx = contextPO.getCtx();
trxName = contextPO.get_TrxName();
}
else
{
ctx = Env.getCtx();
trxName = null;
}
final I_AD_Migration migration = getCreateMigration(migrationCtx, entityType);
final I_AD_MigrationStep migrationStep = InterfaceWrapperHelper.create(ctx, I_AD_MigrationStep.class, trxName);
migrationStep.setAD_Migration(migration);
return migrationStep;
}
示例3: updateContext
import org.compiere.model.PO; //导入方法依赖的package包/类
/**
* Export attributes from session to context.
*
* Used context prefix is {@link #CTX_Prefix}.
*
* Attributes that will be exported to context are: String with FieldLength <= 60.
*
* @return true if context was updated
*/
public boolean updateContext(final Properties ctx)
{
final int sessionId = getAD_Session_ID();
if (sessionId <= 0)
{
log.warn("Cannot update context because session is not saved yet");
return false;
}
if (!sessionPO.isActive())
{
log.debug("Cannot update context because session is not active");
return false;
}
if (isDestroyed())
{
log.debug("Cannot update context because session is destroyed");
return false;
}
//
// If not force, update the context only if the context #AD_Session_ID is same as our session ID.
// Even if there is no value in context, the session won't be updated.
// Keep this logic because we are calling this method on afterSave too.
final int ctxSessionId = Env.getContextAsInt(ctx, Env.CTXNAME_AD_Session_ID);
if (ctxSessionId > 0 && ctxSessionId != sessionId)
{
log.debug("Different AD_Session_ID found in context and force=false.");
}
Env.setContext(ctx, Env.CTXNAME_AD_Session_ID, sessionId);
final PO po = InterfaceWrapperHelper.getStrictPO(sessionPO);
final int cols = po.get_ColumnCount();
for (int i = 0; i < cols; i++)
{
if (!isContextAttribute(i))
{
continue;
}
final String columnName = po.get_ColumnName(i);
final String value = po.get_ValueAsString(columnName);
Env.setContext(ctx, CTX_Prefix + columnName, value);
}
return true;
}
示例4: parseField
import org.compiere.model.PO; //导入方法依赖的package包/类
private static void parseField(PO po, String columnName, Collection<MADBoilerPlateVar> vars)
{
final String text = po.get_ValueAsString(columnName);
if (Check.isEmpty(text, true))
return;
//
final BoilerPlateContext attributes = BoilerPlateContext.builder()
.setSourceDocumentFromObject(po)
.build();
//
final Matcher m = MADBoilerPlate.NameTagPattern.matcher(text);
final StringBuffer sb = new StringBuffer();
while (m.find())
{
final String refName = MADBoilerPlate.getTagName(m);
//
MADBoilerPlateVar var = null;
for (MADBoilerPlateVar v : vars)
{
if (refName.equals(v.getValue().trim()))
{
var = v;
break;
}
}
//
final String replacement;
if (var != null)
{
replacement = MADBoilerPlate.getPlainText(var.evaluate(attributes));
}
else
{
replacement = m.group();
}
m.appendReplacement(sb, replacement);
}
m.appendTail(sb);
final String textParsed = sb.toString();
po.set_ValueOfColumn(columnName, textParsed);
}