Is there any way to debug the schema file?

When creating custom schema overlays and extensions, it can be difficult to identify problems. The following are unsupported attributes that can be placed in the schema to generate debugging information. These are not guaranteed to work with future versions, since we're still figuring out the best way to expose debugging to developers.

To use these attributes, add them to the schema definition of the element you are trying to debug:

  • debug
    Example: debug="true"
    Adding this attribute tells the configuration system to turn on debugging anytime a property is requested that uses this definition. Right now this shows you the property being passed through the resolver chain, with some resolvers provided more detailed information. This is the latest attempt at exposing debugging and a lot of resolvers still don't provide debugging info.

  • attributesDebug, elementsDebug
    Example: attributesDebug="url"
    If you add an attribute called attributesDebug or elementsDebug to the schema with a comma-separated list of the properties you want debugging turned on for, you'll get detailed debugging for the instance resolver, which is the resolver which creates the actual object and sets it as a property on a parent object. This one is useful when trying to see if the property was read or not because it tells you what the result of evaluting the property as an object was.

  • elementsLog, attributesLog
    Example: attributesLog="Setting the property %{property} at path %{path}"
    These evaluate the contents of the log message as an expression with two additional "special" expressions: %{property}, which displays the name of the property being retrieved and %{path}, which displays the configuration path to the property. The string that results from this evaluation is printed to standard out.

  • constructorLog
    Example: constructorLog="Constructing the element at %{path}"
    Uses the same special expressions plus the normal expression support as the elementsLog, with the exception that %{property} is ignored. Written to stdout when an object is first being created.

Some quick samples include:
<menu class="com.labescape.common.swingui.SwingPopupMenu"
      debug="true"
      attributes="name,backgroundColor"
      elements="border,menuItem,size,controller"
      ...>

   ...
   
</menu>

The above example will print debugging messages whenever a configuration property that references the menu schema element is processed. In Enterprise Tree Map, this occurs on the config.treemap.uiElements.menu property.

<menu class="com.labescape.common.swingui.SwingPopupMenu"
      elementsDebug="menuItem"
      attributes="name,backgroundColor"
      elements="border,menuItem,size,controller"
      ...>

   <menuItem class="com.labescape.treemap.swingui.SwingMenuItem"
             ...>
      ...             
   </menuItem>

   ...

</menu>

The above example will print debugging messages whenever the a configuration property that references the menuItem element of the menu schema element is processed. These are different than the general debug because they are focused on the relationship between menu and menuItem.

<menu class="com.labescape.common.swingui.SwingPopupMenu"
      constructorLog="Constructing the element at %{path}"
      ...>

   ...

</menu>

The above example will print a message whenever a menu is created. A typical configuration file will print the following once:

Constructing the element at config.treemap.uiElements.menu