本文整理了Java中org.apache.isis.core.metamodel.adapter.oid.Oid.enString()
方法的一些代码示例,展示了Oid.enString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Oid.enString()
方法的具体详情如下:
包路径:org.apache.isis.core.metamodel.adapter.oid.Oid
类名称:Oid
方法名:enString
暂无
代码示例来源:origin: org.apache.isis.core/isis-core-runtime
private static <T extends Oid> T clone(final T oid) {
if(oid == null) { return null; }
final String oidStr = oid.enString();
return (T) OID_MARSHALLER.unmarshal(oidStr, oid.getClass());
}
代码示例来源:origin: org.apache.isis.core/isis-core-viewer-wicket-model
/**
* Factory method for creating {@link PageParameters}.
*
* see {@link #ActionModel(PageParameters, SpecificationLoader)}
*/
public static PageParameters createPageParameters(
final ObjectAdapter adapter, final ObjectAction objectAction, final ConcurrencyChecking concurrencyChecking) {
final PageParameters pageParameters = PageParametersUtils.newPageParameters();
final String oidStr = concurrencyChecking == ConcurrencyChecking.CHECK?
adapter.getOid().enString():
adapter.getOid().enStringNoVersion();
PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
final ActionType actionType = objectAction.getType();
PageParameterNames.ACTION_TYPE.addEnumTo(pageParameters, actionType);
final ObjectSpecification actionOnTypeSpec = objectAction.getOnType();
if (actionOnTypeSpec != null) {
PageParameterNames.ACTION_OWNING_SPEC.addStringTo(pageParameters, actionOnTypeSpec.getFullIdentifier());
}
final String actionId = determineActionId(objectAction);
PageParameterNames.ACTION_ID.addStringTo(pageParameters, actionId);
return pageParameters;
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-impl
/**
* Converts {@link ObjectAdapter} to string representation of {@link Oid}.
*/
@Override
public String convertToString(final ObjectAdapter adapter, final Locale locale) {
final Oid oid = adapter.getOid();
if (oid == null) {
// values don't have an Oid
return null;
}
return oid.enString();
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-model
/**
* Factory method for creating {@link PageParameters}.
*
* see {@link #ActionModel(PageParameters, SpecificationLoader)}
*/
public static PageParameters createPageParameters(
final ObjectAdapter adapter, final ObjectAction objectAction, final ConcurrencyChecking concurrencyChecking) {
final PageParameters pageParameters = PageParametersUtils.newPageParameters();
final String oidStr = concurrencyChecking == ConcurrencyChecking.CHECK?
adapter.getOid().enString():
adapter.getOid().enStringNoVersion();
PageParameterNames.OBJECT_OID.addStringTo(pageParameters, oidStr);
final ActionType actionType = objectAction.getType();
PageParameterNames.ACTION_TYPE.addEnumTo(pageParameters, actionType);
final ObjectSpecification actionOnTypeSpec = objectAction.getOnType();
if (actionOnTypeSpec != null) {
PageParameterNames.ACTION_OWNING_SPEC.addStringTo(pageParameters, actionOnTypeSpec.getFullIdentifier());
}
final String actionId = determineActionId(objectAction);
PageParameterNames.ACTION_ID.addStringTo(pageParameters, actionId);
return pageParameters;
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-impl
/**
* hook method
*/
protected String linkRef() {
if (resourceContext == null) {
throw new IllegalStateException("resourceContext not provided");
}
if (objectAdapter == null) {
throw new IllegalStateException("objectAdapter not provided");
}
final StringBuilder buf = new StringBuilder("objects/");
buf.append(objectAdapter.getOid().enString(getOidMarshaller()));
return buf.toString();
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-restfulobjects-impl
public static String getOidStr(final ResourceContext resourceContext, final ObjectAdapter objectAdapter) {
final Oid oid = objectAdapter.getOid();
if(!(oid instanceof RootOid)) {
throw new IllegalArgumentException("objectAdapter must be a root adapter");
}
return oid != null ? oid.enString(getOidMarshaller()) : null;
}
代码示例来源:origin: org.apache.isis.core/isis-core-runtime
@Override
public void execute() {
if (LOG.isDebugEnabled()) {
LOG.debug("resolveImmediately; oid={}", adapter.getOid().enString());
}
if (!adapter.representsPersistent()) {
if (LOG.isDebugEnabled()) {
LOG.debug("; not persistent - ignoring");
}
return;
}
refreshRoot(adapter);
}
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-model
@Override
public void resetVersion(
ObjectAdapterMemento oam,
final PersistenceSession persistenceSession,
final SpecificationLoader specificationLoader) {
// REVIEW: this may be redundant because recreateAdapter also guarantees the version will be reset.
final ObjectAdapter adapter = recreateAdapter(
oam, ConcurrencyChecking.NO_CHECK, persistenceSession, specificationLoader);
Oid oid = adapter.getOid();
oam.persistentOidStr = oid.enString();
}
代码示例来源:origin: org.apache.isis.core/isis-core-viewer-wicket-model
@Override
public void resetVersion(
final ObjectAdapterMemento oam,
final PersistenceSession persistenceSession,
final SpecificationLoader specificationLoader) {
// REVIEW: this may be redundant because recreateAdapter also guarantees the version will be reset.
final ObjectAdapter adapter = recreateAdapter(
oam, ConcurrencyChecking.NO_CHECK, persistenceSession, specificationLoader);
Oid oid = adapter.getOid();
oam.persistentOidStr = oid.enString();
}
代码示例来源:origin: org.apache.isis.core/isis-core-runtime
@Override
public String toString(Object object) {
if(object == null) {
return null;
}
final ObjectAdapter adapter = isisSessionFactory.getCurrentSession()
.getPersistenceSession().adapterFor(object);
Oid oid = adapter.getOid();
return oid != null? oid.enString(): encodedValueOf(adapter);
}
private String encodedValueOf(ObjectAdapter adapter) {
代码示例来源:origin: org.apache.isis.viewer/isis-viewer-wicket-impl
/**
* Converts {@link ObjectAdapterMemento} to string representation of
* {@link RootOid}.
*/
@Override
public String convertToString(final ObjectAdapterMemento memento, final Locale locale) {
if (memento == null) {
return null;
}
final Oid oid = memento.getObjectAdapter(ConcurrencyChecking.NO_CHECK, getPersistenceSession(),
getSpecificationLoader()).getOid();
if (oid == null) {
// values don't have an Oid...
// REVIEW: is this right?
return memento.toString();
}
return oid.enString();
}
代码示例来源:origin: org.isisaddons.wicket.fullcalendar2/isis-wicket-fullcalendar2-cpt
public Event apply(final ObjectAdapter input) {
final Object domainObject = input.getObject();
final CalendarEvent calendarEvent = calendarEventFor(domainObject, calendarName);
if(calendarEvent == null) {
return null;
}
final Event event = new Event();
final DateTime start = calendarEvent.getDateTime();
final DateTime end = start;
event.setStart(start);
event.setEnd(end);
event.setAllDay(true);
final Object dereferencedObject = dereference(domainObject);
final ObjectAdapter dereferencedAdapter = getPersistenceSession().adapterFor(dereferencedObject);
final String oidStr = dereferencedAdapter.getOid().enString();
event.setId(oidStr + "-" + calendarName);
event.setClassName("fullCalendar2-event-" + calendarName);
event.setEditable(false);
event.setPayload(oidStr);
event.setTitle(calendarEvent.getTitle());
//event.setBackgroundColor(backgroundColor)
//event.setBorderColor(borderColor)
//event.setColor(color)
//event.setTextColor(textColor)
//event.setUrl(url)
return event;
}
内容来源于网络,如有侵权,请联系作者删除!