View Javadoc
1 /* 2 * $Header: /cvsroot/ebxmlrr/jaxr/src/com/sun/xml/registry/ebxml/infomodel/PersonNameImpl.java,v 1.8 2003/07/18 15:18:07 farrukh_najmi Exp $ 3 * 4 * 5 */ 6 7 package com.sun.xml.registry.ebxml.infomodel; 8 9 import javax.xml.registry.*; 10 import javax.xml.registry.infomodel.*; 11 import com.sun.xml.registry.ebxml.LifeCycleManagerImpl; 12 13 import org.oasis.ebxml.registry.bindings.rim.PersonNameType; 14 15 /*** 16 * Class Declaration for Class1 17 * @author <a href="mailto:Farrukh.Najmi@Sun.COM">Farrukh S. Najmi</a> 18 */ 19 public class PersonNameImpl implements PersonName { 20 21 private String lastName = null; 22 private String middleName = null; 23 private String firstName = null; 24 // private String fullName = null; // ?? Spec issue w/ format conversion 25 26 public PersonNameImpl(LifeCycleManagerImpl lcm) { 27 } 28 29 public PersonNameImpl(LifeCycleManagerImpl lcm, PersonNameType ebPersonName) { 30 firstName = ebPersonName.getFirstName(); 31 middleName = ebPersonName.getMiddleName(); 32 lastName = ebPersonName.getLastName(); 33 } 34 35 public String getLastName() throws JAXRException { 36 if (lastName == null) { 37 lastName = ""; 38 } 39 return lastName; 40 } 41 42 public void setLastName(String par1) throws JAXRException { 43 lastName = par1; 44 } 45 46 public String getFirstName() throws JAXRException { 47 if (firstName == null) { 48 firstName = ""; 49 } 50 return firstName; 51 } 52 53 public void setFirstName(String par1) throws JAXRException { 54 firstName = par1; 55 } 56 57 public String getMiddleName() throws JAXRException { 58 if (middleName == null) { 59 middleName = ""; 60 } 61 return middleName; 62 } 63 64 public void setMiddleName(String par1) throws JAXRException { 65 middleName = par1; 66 } 67 68 public String getFullName() throws JAXRException { 69 StringBuffer fullName = new StringBuffer(); 70 if (getFirstName() != null) { 71 fullName.append(getFirstName()); 72 } 73 74 if (fullName.length() > 0) { 75 fullName.append(" "); 76 } 77 78 if (getMiddleName() != null) { 79 fullName.append(getMiddleName()); 80 } 81 82 if (fullName.length() > 0) { 83 fullName.append(" "); 84 } 85 86 if (getLastName() != null) { 87 fullName.append(getLastName()); 88 } 89 return fullName.toString(); 90 } 91 92 public void setFullName(String par1) throws JAXRException { 93 // ??eeg Spec issue w/ conversion between first + middle + last and 94 // fullname formats 95 // fullName = par1; 96 setLastName(par1); 97 } 98 99 /*** 100 * This method takes this JAXR infomodel object and returns an 101 * equivalent binding object for it. Note it does the reverse of one 102 * of the constructors above. 103 */ 104 public org.oasis.ebxml.registry.bindings.rim.PersonName toBindingObject() throws JAXRException { 105 org.oasis.ebxml.registry.bindings.rim.PersonName ebPersonName = 106 new org.oasis.ebxml.registry.bindings.rim.PersonName(); 107 108 setBindingObject(ebPersonName); 109 110 return ebPersonName; 111 } 112 113 protected void setBindingObject(org.oasis.ebxml.registry.bindings.rim.PersonNameType ebPersonName) throws JAXRException { 114 115 ebPersonName.setFirstName(getFirstName()); 116 ebPersonName.setMiddleName(getMiddleName()); 117 ebPersonName.setLastName(getLastName()); 118 } 119 }

This page was automatically generated by Maven