Package org.freezedry.persistence.keyvalue.renderers

Examples of org.freezedry.persistence.keyvalue.renderers.PersistenceRenderer


      // all we need is to grab the first key and use it as a pattern for the remaining
      // key-value pairs in this group
      final String rootKey = keyValues.get( 0 ).getFirst();
     
      // get the appropriate renderer and ask it to build the info node from that type
      final PersistenceRenderer renderer = getRenderer( rootKey );
      if( renderer != null )
      {
        renderer.buildInfoNode( parentNode, keyValues );
      }
      else
      {
        final InfoNode node = InfoNode.createCompoundNode( null, groupName, null );
        parentNode.addChild( node );
View Full Code Here


   * @return the group name from the specified key, or null if no renderer claims it
   */
  private String getGroupName( final String key )
  {
    String group = null;
    final PersistenceRenderer renderer = getRenderer( key );
    if( renderer != null )
    {
      group = renderer.getGroupName( key );
    }
    return group;
  }
View Full Code Here

   * @return the {@link PersistenceRenderer} for which the specified key matches its regular expression for keys;
   * null if no {@link PersistenceRenderer} is found.
   */
  public PersistenceRenderer getRenderer( final String key )
  {
    PersistenceRenderer matchingRenderer = null;
    for( PersistenceRenderer renderer : renderers.values() )
    {
      if( renderer.isRenderer( key ) )
      {
        matchingRenderer = renderer;
View Full Code Here

      // all we need is to grab the first key and use it as a pattern for the remaining
      // key-value pairs in this group
      final String rootKey = keyValues.get( 0 ).getFirst();
     
      // get the appropriate renderer and ask it to build the info node from that type
      final PersistenceRenderer renderer = getRenderer( rootKey );
      if( renderer != null )
      {
        renderer.buildInfoNode( parentNode, keyValues );
      }
      else
      {
        final InfoNode node = InfoNode.createCompoundNode( null, groupName, null );
        parentNode.addChild( node );
View Full Code Here

   * @return the group name from the specified key, or null if no renderer claims it
   */
  private String getGroupName( final String key )
  {
    String group = null;
    final PersistenceRenderer renderer = getRenderer( key );
    if( renderer != null )
    {
      group = renderer.getGroupName( key );
    }
    return group;
  }
View Full Code Here

      }

      // in this case, the renderer for the key name should be a leaf-node renderer, so
      // lets pull it, and then ask it to build the info node for us, and add that new
      // info node to the parent, and then we're done
      PersistenceRenderer renderer = getRenderer( name );
      if( renderer == null )
      {
        renderer = getRenderer( String.class );
      }
      renderer.buildInfoNode( parentNode, keyValues );
    }
    // for compound nodes, we need to call the appropriate renderer's buildInfoNode(...) method. and
    // let the recursion begin.
    else
    {
      // grab the key from the first key value, and since all keys have the same group
      // all we need is to grab the first key and use it as a pattern for the remaining
      // key-value pairs in this group
      final String rootKey = keyValues.get( 0 ).getFirst();
     
      // get the appropriate renderer and ask it to build the info node from that type
      final PersistenceRenderer renderer = getRenderer( rootKey );
      if( renderer != null )
      {
        renderer.buildInfoNode( parentNode, keyValues );
      }
      else
      {
        final InfoNode node = InfoNode.createCompoundNode( null, groupName, null );
        parentNode.addChild( node );
View Full Code Here

   * @return the group name from the specified key, or null if no renderer claims it
   */
  private String getGroupName( final String key )
  {
    String group = null;
    final PersistenceRenderer renderer = getRenderer( key );
    if( renderer != null )
    {
      group = renderer.getGroupName( key );
    }
    return group;
  }
View Full Code Here

TOP

Related Classes of org.freezedry.persistence.keyvalue.renderers.PersistenceRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.