Package org.freezedry.persistence.keyvalue.renderers.decorators

Examples of org.freezedry.persistence.keyvalue.renderers.decorators.Decorator


   * @return the {@link Decorator} that was used to decorate the specified value, or
   * if no such {@link Decorator} was found, returns null.
   */
  public Decorator getDecorator( final String value )
  {
    Decorator foundDecorator = null;
    for( Decorator decorator : decorators.values() )
    {
      if( decorator.isDecorated( value ) )
      {
        foundDecorator = decorator;
View Full Code Here


   * @return the {@link Decorator} that was used to decorate the specified value, or
   * if no such {@link Decorator} was found, returns null.
   */
  public Decorator getDecorator( final String value )
  {
    Decorator foundDecorator = null;
    for( Decorator decorator : decorators.values() )
    {
      if( decorator.isDecorated( value ) )
      {
        foundDecorator = decorator;
View Full Code Here

      if( leafMatcher.find() )
      {
        // its a leaf, so now we need to figure out what the value is. we know that
        // it must be a number (integer, double) or a string.
        final String value = keyValue.getSecond();
        final Decorator decorator = getDecorator( value );
        final String rawValue = decorator.undecorate( value );
        final String persistName = decorator.representedClass().getSimpleName();
       
        // create the leaf info node and add it to the collection node
        final InfoNode elementNode = InfoNode.createLeafNode( null, rawValue, persistName, null );
        collectionNode.addChild( elementNode );
      }
View Full Code Here

      int index = 0;
      final int numChildren = infoNode.getChildCount();
      for( InfoNode node : infoNode.getChildren() )
      {
        // add the decorated value
        final Decorator decorator = getDecorator( node.getClazz() );
        value.append( decorator.decorate( node.getValue() ) );
       
        // add a comma between the values if it isn't the last value
        if( index < numChildren-1 )
        {
          value.append( listSeparator + " " );
View Full Code Here

           
            for( String value : values )
            {
              // its a leaf, so now we need to figure out what the value is. we know that
              // it must be a number (integer, double) or a string.
              final Decorator decorator = getDecorator( value);
              final String rawValue = decorator.undecorate( value );
              final String persistName = decorator.representedClass().getSimpleName();
             
              // create the leaf info node and add it to the collection node
              final InfoNode elementNode = InfoNode.createLeafNode( null, rawValue, persistName, null );
              collectionNode.addChild( elementNode );
            }
View Full Code Here

    final String key = keyValues.get( 0 ).getFirst();
    final String value = keyValues.get( 0 ).getSecond();

    // grab the decorator for the value. if no decorator is found, then use the raw value as is, which
    // means that it'll be treated as a string value
    final Decorator decorator = getDecorator( value );
    String rawValue;
    if( decorator == null )
    {
      rawValue = value;
    }
    else
    {
      rawValue = decorator.undecorate( value );
    }
    final InfoNode node = InfoNode.createLeafNode( null, rawValue, key, null );
    parentNode.addChild( node );
  }
View Full Code Here

   * @return the {@link Decorator} that was used to decorate the specified value, or
   * if no such {@link Decorator} was found, returns null.
   */
  public Decorator getDecorator( final String value )
  {
    Decorator foundDecorator = null;
    for( Decorator decorator : decorators.values() )
    {
      if( decorator.isDecorated( value ) )
      {
        foundDecorator = decorator;
View Full Code Here

      if( leafMatcher.find() )
      {
        // its a leaf, so now we need to figure out what the value is. we know that
        // it must be a number (integer, double) or a string.
        final String value = keyValue.getSecond();
        final Decorator decorator = getDecorator( value );
        final String rawValue = decorator.undecorate( value );
        final String persistName = decorator.representedClass().getSimpleName();
       
        // create the leaf info node and add it to the collection node
        final InfoNode elementNode = InfoNode.createLeafNode( null, rawValue, persistName, null );
        collectionNode.addChild( elementNode );
      }
View Full Code Here

      int index = 0;
      final int numChildren = infoNode.getChildCount();
      for( InfoNode node : infoNode.getChildren() )
      {
        // add the decorated value
        final Decorator decorator = getDecorator( node.getClazz() );
        value.append( decorator.decorate( node.getValue() ) );
       
        // add a comma between the values if it isn't the last value
        if( index < numChildren-1 )
        {
          value.append( listSeparator + " " );
View Full Code Here

           
            for( String value : values )
            {
              // its a leaf, so now we need to figure out what the value is. we know that
              // it must be a number (integer, double) or a string.
              final Decorator decorator = getDecorator( value);
              final String rawValue = decorator.undecorate( value );
              final String persistName = decorator.representedClass().getSimpleName();
             
              // create the leaf info node and add it to the collection node
              final InfoNode elementNode = InfoNode.createLeafNode( null, rawValue, persistName, null );
              collectionNode.addChild( elementNode );
            }
View Full Code Here

TOP

Related Classes of org.freezedry.persistence.keyvalue.renderers.decorators.Decorator

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.