Examples of TagElement


Examples of etch.util.core.xml.XmlParser.TagElement

    stack.push( te );
  }

  public void endMessage( Message msg ) throws IOException
  {
    TagElement te = stack.pop();
    if (!stack.isEmpty())
      throw new IOException( "stack sequence error: "+stack );
    te.toString( wtr );
  }
View Full Code Here

Examples of etch.util.core.xml.XmlParser.TagElement

  }

  public void startStruct( StructValue struct )
  {
    // the caller has already created an element tag for us.
    TagElement te = stack.peek();
    te.setAttr( null, STRUCT_TYPE_ATTR, struct.type().getId() );
  }
View Full Code Here

Examples of etch.util.core.xml.XmlParser.TagElement

    // stack.pop();
  }

  public void writeStructElement( Field key, Object value ) throws IOException
  {
    TagElement te = stack.peek().addTag( ELEMENT_TAG );
    te.setAttr( null, KEY_ATTR, key.getId() );
    stack.push( te );
    writeValue( value );
    stack.pop();
  }
View Full Code Here

Examples of etch.util.core.xml.XmlParser.TagElement

    stack.pop();
  }

  public void writeArrayElement( Object value ) throws IOException
  {
    TagElement te = stack.peek().addTag( ELEMENT_TAG );
    stack.push( te );
    writeValue( value );
    stack.pop();
  }
View Full Code Here

Examples of etch.util.core.xml.XmlParser.TagElement

  @SuppressWarnings("deprecation")
  private void writeValue( Object value ) throws IOException
  {
    // the caller has already created an element for us.
   
    TagElement te = stack.peek();
   
    int type = checkValue( value );
   
    switch (type)
    {
      case TypeCode.NULL:
      {
        te.setAttr( null, ELEMENT_TYPE_ATTR, NULL_TYPE );
        break;
      }
     
      case TypeCode.BOOLEAN_FALSE:
      case TypeCode.BOOLEAN_TRUE:
      {
        te.setAttr( null, ELEMENT_TYPE_ATTR, BOOLEAN_TYPE );
        te.addCdata( value.toString() );
        break;
      }
     
      case TypeCode.BYTE:
      case TypeCode.SHORT:
      case TypeCode.INT:
      {
        te.setAttr( null, ELEMENT_TYPE_ATTR, INTEGER_TYPE );
        te.addCdata( value.toString() );
        break;
      }
     
      case TypeCode.LONG:
      {
        te.setAttr( null, ELEMENT_TYPE_ATTR, LONG_TYPE );
        te.addCdata( value.toString() );
        break;
      }
     
      case TypeCode.FLOAT:
      {
        te.setAttr( null, ELEMENT_TYPE_ATTR, FLOAT_TYPE );
        te.addCdata( value.toString() );
        break;
      }
     
      case TypeCode.DOUBLE:
      {
        te.setAttr( null, ELEMENT_TYPE_ATTR, DOUBLE_TYPE );
        te.addCdata( value.toString() );
        break;
      }
     
      case TypeCode.BYTES:
      {
        byte[] b = (byte[]) value;
        te.setAttr( null, ELEMENT_TYPE_ATTR, BYTES_TYPE );
        te.addCdata( bytes2string( b ) );
        break;
      }
     
      case TypeCode.EMPTY_STRING:
      case TypeCode.STRING:
      {
        String s = (String) value;
        te.setAttr( null, ELEMENT_TYPE_ATTR, STRING_TYPE );
        te.addCdata( s );
        break;
      }
     
      case TypeCode.ARRAY:
        te.setAttr( null, ELEMENT_TYPE_ATTR, ARRAY_TYPE );
        if (value instanceof ArrayValue)
          writeArray( (ArrayValue) value, null );
        else
          writeArray( toArrayValue( value, null ), null );
        break;
       
      case TypeCode.STRUCT:
      case TypeCode.CUSTOM:
      {
        StructValue struct = vf.exportCustomValue( value );
       
        if (struct == null)
          throw new UnsupportedOperationException( "unsupported type "+value.getClass() );
       
        te.setAttr( null, ELEMENT_TYPE_ATTR, CUSTOM_TYPE );
        writeStruct( struct );
        break;
      }
     
      default:
View Full Code Here

Examples of javax.swing.text.html.parser.TagElement

        HTML.Tag t = tags [ i ];
        String tn = t.toString();
        Element e = DTD.getDTD("test").getElement("e");
        e.name = tn;

        TagElement te = new TagElement(e, true);
        assertTrue(" must be fictional", te.fictional());

        te = new TagElement(e);
        assertFalse("must be non fictional", te.fictional());

        assertEquals(te.getHTMLTag().toString(), t.toString());
        assertEquals(t.breaksFlow(), te.breaksFlow());
        assertEquals(t.isPreformatted(), te.isPreformatted());
      }
  }
View Full Code Here

Examples of org.apache.etch.util.core.xml.XmlParser.TagElement

  private final Stack<TagElement> stack = new Stack<TagElement>();

  public void startMessage( Message msg )
  {
    stack.clear();
    TagElement te = new DefaultTagElement( MESSAGE_TAG );
    te.setAttr( null, STRUCT_TYPE_ATTR, msg.type().getId() );
    stack.push( te );
  }
View Full Code Here

Examples of org.apache.etch.util.core.xml.XmlParser.TagElement

    stack.push( te );
  }

  public void endMessage( Message msg ) throws IOException
  {
    TagElement te = stack.pop();
    if (!stack.isEmpty())
      throw new IOException( "stack sequence error: "+stack );
    te.toString( wtr );
  }
View Full Code Here

Examples of org.apache.etch.util.core.xml.XmlParser.TagElement

  }

  public void startStruct( StructValue struct )
  {
    // the caller has already created an element tag for us.
    TagElement te = stack.peek();
    te.setAttr( null, STRUCT_TYPE_ATTR, struct.type().getId() );
  }
View Full Code Here

Examples of org.apache.etch.util.core.xml.XmlParser.TagElement

    // stack.pop();
  }

  public void writeStructElement( Field key, Object value ) throws IOException
  {
    TagElement te = stack.peek().addTag( ELEMENT_TAG );
    te.setAttr( null, KEY_ATTR, key.getId() );
    stack.push( te );
    writeValue( value );
    stack.pop();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.