Package org.apache.juddi.datatype.response

Examples of org.apache.juddi.datatype.response.Property


  {
  }

  public RegistryObject unmarshal(Element element)
  {
    Property obj = new Property();

    // Attributes
    String name = element.getAttribute("name");
    if ((name != null) && (name.trim().length() > 0))
      obj.setName(name);

    String value = element.getAttribute("value");
    if ((value != null) && (value.trim().length() > 0))
      obj.setValue(value);

    // Text Node Value
    // {none}

    // Child Elements
View Full Code Here


    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    Property property = (Property)object;
    String generic = getGeneric(null);
    String namespace = getUDDINamespace(generic);
    Element element = parent.getOwnerDocument().createElementNS(namespace,TAG_NAME);

    String name = property.getName();
    if ((name != null) && (name.trim().length() > 0))
      element.setAttribute("name",name);

    String value = property.getValue();
    if ((value != null) && (value.trim().length() > 0))
      element.setAttribute("value",value);

    parent.appendChild(element);
  }
View Full Code Here

  public static void main(String args[])
    throws Exception
  {
    // create the source object
    Property inprop = new Property("nameAttr","valueAttr");

    // unmarshal & marshal (object->xml->object)
    HandlerMaker maker = HandlerMaker.getInstance();
    AbstractHandler handler = maker.lookup(PropertyHandler.TAG_NAME);
    Element element = null;
View Full Code Here

      SortedSet sortedProps = new TreeSet(props.keySet());
      for (Iterator keys = sortedProps.iterator(); keys.hasNext() ; )
      {
        String name = (String)keys.next();
        String value = (String)props.getProperty(name);
        handler.marshal(new Property(name,value),element);
      }
    }

    parent.appendChild(element);
  }
View Full Code Here

    Element parent = XMLUtils.newRootElement();
    Element child = null;

    RegistryInfo regInfo = new RegistryInfo();
    regInfo.addProperty(new Property("first_name","Steve"));
    regInfo.addProperty(new Property("last_name","Viens"));
    regInfo.addProperty(new Property("version","1.0b1"));

    System.out.println();

    RegistryObject regObject = regInfo;
    handler.marshal(regObject,parent);
View Full Code Here

      SortedSet sortedProps = new TreeSet(props.keySet());
      for (Iterator keys = sortedProps.iterator(); keys.hasNext() ; )
      {
        String name = (String)keys.next();
        String value = (String)props.getProperty(name);
        handler.marshal(new Property(name,value),element);
      }
    }

    parent.appendChild(element);
  }
View Full Code Here

    Element parent = XMLUtils.newRootElement();
    Element child = null;

    RegistryInfo regInfo = new RegistryInfo();
    regInfo.addProperty(new Property("first_name","Steve"));
    regInfo.addProperty(new Property("last_name","Viens"));
    regInfo.addProperty(new Property("version","1.0b1"));

    System.out.println();

    RegistryObject regObject = regInfo;
    handler.marshal(regObject,parent);
View Full Code Here

    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    Property obj = new Property();

    // Attributes
    String name = element.getAttribute("name");
    if ((name != null) && (name.trim().length() > 0))
      obj.setName(name);

    String value = element.getAttribute("value");
    if ((value != null) && (value.trim().length() > 0))
      obj.setValue(value);

    // Text Node Value
    // {none}

    // Child Elements
View Full Code Here

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    Property property = (Property)object;
    Element element = parent.getOwnerDocument().createElementNS(null,TAG_NAME);

    String name = property.getName();
    if ((name != null) && (name.trim().length() > 0))
      element.setAttribute("name",name);

    String value = property.getValue();
    if ((value != null) && (value.trim().length() > 0))
      element.setAttribute("value",value);

    parent.appendChild(element);
  }
View Full Code Here

  public static void main(String args[])
    throws Exception
  {
    // create the source object
    Property inprop = new Property("nameAttr","valueAttr");

    // unmarshal & marshal (object->xml->object)
    HandlerMaker maker = HandlerMaker.getInstance();
    AbstractHandler handler = maker.lookup(PropertyHandler.TAG_NAME);
    Element element = null;
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.response.Property

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.