Package org.apache.juddi.datatype

Examples of org.apache.juddi.datatype.AddressLine


    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    AddressLine line = (AddressLine)object;
    Element element = parent.getOwnerDocument().createElement(TAG_NAME);

    String keyName = line.getKeyName();
    if ((keyName != null) && (keyName.trim().length() > 0))
      element.setAttribute("keyName",keyName);

    String keyValue = line.getKeyValue();
    if ((keyValue != null) && (keyValue.trim().length() > 0))
      element.setAttribute("keyValue",keyValue);

    String lineValue = line.getLineValue();
    if (lineValue != null)
      element.appendChild(parent.getOwnerDocument().createTextNode(lineValue));

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


  public static void main(String args[])
    throws Exception
  {
    // create the source object
    AddressLine lineIn = new AddressLine("AddressLine1","keyNameAttr","keyValueAttr");

    // unmarshal & marshal (object->xml->object)
    HandlerMaker maker = HandlerMaker.getInstance();
    AbstractHandler handler = maker.lookup(AddressLineHandler.TAG_NAME);
    Element element = null;
    handler.marshal(lineIn,element);
    AddressLine lineOut = (AddressLine)handler.unmarshal(element);

    // compare unmarshaled with marshaled obj
    if (lineOut.equals(lineIn))
      System.out.println("Input and output are the same.");
    else
      System.out.println("Input and output are NOT the same!");
  }
View Full Code Here

    Address address = new Address();
    address.setUseType("myAddressUseType");
    address.setSortCode("sortThis");
    address.setTModelKey(null);
    address.addAddressLine(new AddressLine("AddressLine1","keyNameAttr","keyValueAttr"));
    address.addAddressLine(new AddressLine("AddressLine2"));

    Contact contact = new Contact();
    contact.setUseType("myAddressUseType");
    contact.setPersonNameValue("Bob Whatever");
    contact.addDescription(new Description("Bob is a big fat jerk"));
View Full Code Here

      // execute the statement
      resultSet = statement.executeQuery();
      while (resultSet.next())
      {
        AddressLine line = new AddressLine();
        line.setLineValue(resultSet.getString(1));//("LINE")
        line.setKeyName(resultSet.getString(2));//("KEY_NAME"));
        line.setKeyValue(resultSet.getString(3));//("KEY_VALUE"));
        lineList.add(line);
      }

      return lineList;
    }
View Full Code Here

        Vector addrList = new Vector();
        addrList.add(address);
        int addressID = 0;

        AddressLine addrLine1 = new AddressLine();
        addrLine1.setLineValue("SteveViens.com, Inc.");

        AddressLine addrLine2 = new AddressLine();
        addrLine2.setLineValue("PO BOX 6856");

        AddressLine addrLine3 = new AddressLine();
        addrLine3.setLineValue("78 Marne Avenue");

        AddressLine addrLine4 = new AddressLine();
        addrLine4.setLineValue("Portsmouth");

        AddressLine addrLine5 = new AddressLine();
        addrLine5.setLineValue("New Hampshire");

        Vector lineList = new Vector();
        lineList.add(addrLine1);
        lineList.add(addrLine2);
        lineList.add(addrLine3);
View Full Code Here

      statement.setInt(3,addressID);

      int listSize = lineList.size();
      for (int lineID=0; lineID<listSize; lineID++)
      {
        AddressLine line = (AddressLine)lineList.elementAt(lineID);
        statement.setInt(4,lineID);
        statement.setString(5,line.getLineValue());
        statement.setString(6,line.getKeyName());
        statement.setString(7,line.getKeyValue());

        log.debug("insert into ADDRESS_LINE table:\n\n\t" + insertSQL +
          "\n\t BUSINESS_KEY=" + businessKey.toString() +
          "\n\t CONTACT_ID=" + contactID +
          "\n\t ADDRESS_ID=" + addressID +
          "\n\t ADDRESS_LINE_ID=" + lineID +
          "\n\t LINE=" + line.getLineValue() +
          "\n\t KEY_NAME=" + line.getKeyName() +
          "\n\t KEY_VALUE=" + line.getKeyValue() + "\n");

        statement.executeUpdate();
      }
    }
    finally
View Full Code Here

    Address address = new Address();
    address.setUseType("myAddressUseType");
    address.setSortCode("sortThis");
    address.setTModelKey(null);
    address.addAddressLine(new AddressLine("AddressLine1","keyNameAttr","keyValueAttr"));
    address.addAddressLine(new AddressLine("AddressLine2"));

    Contact contact = new Contact();
    contact.setUseType("myAddressUseType");
    contact.setPersonNameValue("Bob Whatever");
    contact.addDescription(new Description("Bob is a big fat jerk"));
View Full Code Here

    Address address = new Address();
    address.setUseType("myAddressUseType");
    address.setSortCode("sortThis");
    address.setTModelKey(null);
    address.addAddressLine(new AddressLine("AddressLine1","keyNameAttr","keyValueAttr"));
    address.addAddressLine(new AddressLine("AddressLine2"));

    Contact contact = new Contact();
    contact.setUseType("myAddressUseType");
    contact.setPersonNameValue("Bob Whatever");
    contact.addDescription(new Description("Bob is a big fat jerk"));
View Full Code Here

    // unmarshal & marshal (object->xml->object)
    HandlerMaker maker = HandlerMaker.getInstance();
    AbstractHandler handler = maker.lookup(PropertyHandler.TAG_NAME);
    Element element = null;
    handler.marshal(inprop,element);
    AddressLine outprop = (AddressLine)handler.unmarshal(element);

    // compare unmarshaled with marshaled obj
    if (outprop.equals(inprop))
      System.out.println("Input and output are the same.");
    else
      System.out.println("Input and output are NOT the same!");
  }
View Full Code Here

  }

  private RegistryObject getRegistryObject()
  {

    AddressLine object = new AddressLine("AddressLine1","keyNameAttr","keyValueAttr");

    return object;

  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.AddressLine

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.