예제 #1
0
 @Override
 public void debug(final DebugBuilder debug) {
   debug.appendAsHexln("hash", hashCode());
   debug.appendln("context id", id);
   debug.appendln("accessed", DATE_FORMAT.format(new Date(getSessionOpenTime())));
   debugState(debug);
 }
예제 #2
0
파일: Dump.java 프로젝트: wangyaosnake/isis
  public static void specification(
      final ObjectSpecification specification, final DebugBuilder debugBuilder) {
    try {
      debugBuilder.appendTitle(specification.getClass().getName());
      debugBuilder.appendAsHexln("Hash code", specification.hashCode());
      debugBuilder.appendln("ID", specification.getIdentifier());
      debugBuilder.appendln("Full Name", specification.getFullIdentifier());
      debugBuilder.appendln("Short Name", specification.getShortIdentifier());
      debugBuilder.appendln("Singular Name", specification.getSingularName());
      debugBuilder.appendln("Plural Name", specification.getPluralName());
      debugBuilder.appendln("Description", specification.getDescription());
      debugBuilder.blankLine();
      debugBuilder.appendln("Features", featureList(specification));
      debugBuilder.appendln(
          "Type", specification.isParentedOrFreeCollection() ? "Collection" : "Object");
      if (specification.superclass() != null) {
        debugBuilder.appendln("Superclass", specification.superclass().getFullIdentifier());
      }
      debugBuilder.appendln("Interfaces", specificationNames(specification.interfaces()));
      debugBuilder.appendln("Subclasses", specificationNames(specification.subclasses()));
      debugBuilder.blankLine();
      debugBuilder.appendln("Service", specification.isService());
      debugBuilder.appendln("Encodable", specification.isEncodeable());
      debugBuilder.appendln("Parseable", specification.isParseable());
      debugBuilder.appendln("Aggregated", specification.isValueOrIsParented());
    } catch (final RuntimeException e) {
      debugBuilder.appendException(e);
    }

    if (specification instanceof DebuggableWithTitle) {
      ((DebuggableWithTitle) specification).debugData(debugBuilder);
    }

    debugBuilder.blankLine();

    debugBuilder.appendln("Facets");
    final Class<? extends Facet>[] facetTypes = specification.getFacetTypes();
    debugBuilder.indent();
    if (facetTypes.length == 0) {
      debugBuilder.appendln("none");
    } else {
      for (final Class<? extends Facet> type : facetTypes) {
        final Facet facet = specification.getFacet(type);
        debugBuilder.appendln(facet.toString());
      }
    }
    debugBuilder.unindent();
    debugBuilder.blankLine();

    debugBuilder.appendln("Fields");
    debugBuilder.indent();
    specificationFields(specification, debugBuilder);
    debugBuilder.unindent();

    debugBuilder.appendln("Object Actions");
    debugBuilder.indent();
    specificationActionMethods(specification, debugBuilder);
    debugBuilder.unindent();
  }
예제 #3
0
파일: Dump.java 프로젝트: wangyaosnake/isis
  /** @see #adapter(ObjectAdapter) */
  public static void adapter(final ObjectAdapter adapter, final DebugBuilder builder) {
    try {
      builder.appendln("Adapter", adapter.getClass().getName());
      builder.appendln(
          "Class", adapter.getObject() == null ? "none" : adapter.getObject().getClass().getName());
      builder.appendAsHexln("Hash", adapter.hashCode());
      builder.appendln("Object", adapter.getObject());
      builder.appendln("Title", adapter.titleString());
      builder.appendln("Specification", adapter.getSpecification().getFullIdentifier());

      builder.appendln();

      builder.appendln("Icon", adapter.getIconName());
      builder.appendln("OID", adapter.getOid());
      builder.appendln("State", adapter.getResolveState());
      builder.appendln("Version", adapter.getVersion());

    } catch (final RuntimeException e) {
      builder.appendException(e);
    }
  }