protected NakedObjectMemberAbstract( final String id, final Identified facetHolder, final MemberType memberType, final RuntimeContext runtimeContext) { if (id == null) { throw new IllegalArgumentException("Name must always be set"); } this.id = id; this.defaultName = NameConvertorUtils.naturalName(id); this.facetHolder = facetHolder; this.memberType = memberType; this.runtimeContext = runtimeContext; }
protected NakedObjectMemberAbstract( final String id, final Identified facetHolder, final MemberType memberType, final RuntimeContext runtimeContext) { if (id == null) { throw new IllegalArgumentException("Name must always be set"); } this.id = id; this.defaultName = NameConvertorUtils.naturalName(id); this.facetHolder = facetHolder; this.memberType = memberType; this.runtimeContext = runtimeContext; }
public ExceptionMessageContent(final Throwable error) { String fullName = error.getClass().getName(); fullName = fullName.substring(fullName.lastIndexOf('.') + 1); name = NameConvertorUtils.naturalName(fullName); message = error.getMessage(); trace = ExceptionHelper.exceptionTraceAsString(error); if (trace.indexOf("\tat") != -1) { trace = trace.substring(trace.indexOf("\tat")); } if (name == null) { name = ""; } if (message == null) { message = ""; } if (trace == null) { trace = ""; } if (error instanceof NakedObjectApplicationException) { title = "Application Error"; icon = "application-error"; } else if (error instanceof ConcurrencyException) { title = "Concurrency Error"; icon = "concurrency-error"; } else { title = "System Error"; icon = "system-error"; } }
/** * Must be called after the checkForXxxPrefix methods. */ private void defaultNamedFacet( final List<Facet> actionFacets, final MethodRemover methodRemover, final String capitalizedName, final FacetHolder action) { String name = removePrefix(capitalizedName, LOCAL_PREFIX); name = removePrefix(name, REMOTE_PREFIX); name = removePrefix(name, DEBUG_PREFIX); name = removePrefix(name, EXPLORATION_PREFIX); name = removePrefix(name, LOCAL_PREFIX); name = removePrefix(name, REMOTE_PREFIX); name = NameConvertorUtils.naturalName(name); actionFacets.add(new NamedFacetInferred(name, action)); }
/** * Must be called after the checkForXxxPrefix methods. */ private void defaultNamedFacet( final List<Facet> actionFacets, final MethodRemover methodRemover, final String capitalizedName, final FacetHolder action) { String name = removePrefix(capitalizedName, LOCAL_PREFIX); name = removePrefix(name, REMOTE_PREFIX); name = removePrefix(name, DEBUG_PREFIX); name = removePrefix(name, EXPLORATION_PREFIX); name = removePrefix(name, LOCAL_PREFIX); name = removePrefix(name, REMOTE_PREFIX); name = NameConvertorUtils.naturalName(name); actionFacets.add(new NamedFacetInferred(name, action)); }
NamedFacet namedFacet = (NamedFacet) getFacet(NamedFacet.class); if (namedFacet == null) { namedFacet = new NamedFacetInferred(NameConvertorUtils.naturalName(shortName), this); addFacet(namedFacet);
NamedFacet namedFacet = (NamedFacet) getFacet(NamedFacet.class); if (namedFacet == null) { namedFacet = new NamedFacetInferred(NameConvertorUtils.naturalName(shortName), this); addFacet(namedFacet);