/** Human-readable name. */ public String getName() { if (!hasElement(NAME)) { return null; } return getElementValue(NAME); }
@Override public LastModifiedBy lock() { return (LastModifiedBy) super.lock(); }
/** * Constructs a new Person instance with the specified name, URI, * and email address. * * @param key the element key * @param name person's name * @param uri person's URI * @param email person's email address */ public Person(ElementKey<?, ?> key, String name, URI uri, String email) { super(key); setName(name); setUri(uri); setEmail(email); }
@Override public boolean startElement(XmlWriter xw, Element parent, Element e, ElementMetadata<?, ?> metadata) throws IOException { if (!(e instanceof Person)) { return super.startElement(xw, parent, e, metadata); } Person person = (Person) e; String email = person.getEmail(); String name = person.getName(); StringBuilder text = new StringBuilder(); boolean hasEmail = email != null; if (hasEmail) { text.append(email); } if (name != null) { if (hasEmail) { text.append(" ("); } text.append(name); if (hasEmail) { text.append(")"); } } QName xmlName = getName(e, metadata); xw.simpleElement(xmlName.getNs(), xmlName.getLocalName(), null, text.toString()); return false; }
/** * Registers the metadata for this element. */ public static void registerMetadata(MetadataRegistry registry) { if (registry.isRegistered(KEY)) { return; } // Register superclass metadata. Person.registerMetadata(registry); registry.build(KEY); }
/** * Sets URI associated with the person. * * @param v URI */ public void setUri(URI v) { setElement(URI, (v == null) ? null : new Element(URI).setTextValue(v)); }
/** * Gets URI associated with the person. * * @return URI */ public URI getUriUri() { return getElementValue(URI); }
/** * Constructs a new Person instance with the specified name * and key. */ public Person(ElementKey<?, ?> key, String name) { super(key); if (name == null) { throw new NullPointerException("Name must have a value"); } setName(name); }
/** * Gets URI associated with the person. * * @deprecated Use {@link #getUriUri()} instead. * * @return URI */ @Deprecated public String getUri() { URI uri = getUriUri(); if (uri == null) { return null; } return uri.toString(); }
@Override public boolean startElement(XmlWriter xw, Element parent, Element e, ElementMetadata<?, ?> metadata) throws IOException { if (!(e instanceof Person)) { return super.startElement(xw, parent, e, metadata); } Person person = (Person) e; String email = person.getEmail(); String name = person.getName(); StringBuilder text = new StringBuilder(); boolean hasEmail = email != null; if (hasEmail) { text.append(email); } if (name != null) { if (hasEmail) { text.append(" ("); } text.append(name); if (hasEmail) { text.append(")"); } } QName xmlName = getName(e, metadata); xw.simpleElement(xmlName.getNs(), xmlName.getLocalName(), null, text.toString()); return false; }
/** * Registers the metadata for this element. */ public static void registerMetadata(MetadataRegistry registry) { if (registry.isRegistered(KEY)) { return; } // Register superclass metadata. Person.registerMetadata(registry); registry.build(KEY); }
public void setEmail(String v) { setElement(EMAIL, (v == null) ? null : new Element(EMAIL).setTextValue(v)); } }
/** Email address. */ public String getEmail() { return getElementValue(EMAIL); }
/** * Constructs a new Person instance with the specified name * and key. */ public Person(ElementKey<?, ?> key, String name) { super(key); if (name == null) { throw new NullPointerException("Name must have a value"); } setName(name); }
/** * Gets URI associated with the person. * * @deprecated Use {@link #getUriUri()} instead. * * @return URI */ @Deprecated public String getUri() { URI uri = getUriUri(); if (uri == null) { return null; } return uri.toString(); }
/** * Constructs a new Person instance with the specified name, URI, * and email address. * * @param key the element key * @param name person's name * @param uri person's URI * @param email person's email address */ public Person(ElementKey<?, ?> key, String name, URI uri, String email) { super(key); setName(name); setUri(uri); setEmail(email); }
/** Human-readable name. */ public String getName() { if (!hasElement(NAME)) { return null; } return getElementValue(NAME); }
@Override public boolean startElement(XmlWriter xw, Element parent, Element e, ElementMetadata<?, ?> metadata) throws IOException { if (!(e instanceof Person)) { return super.startElement(xw, parent, e, metadata); } Person person = (Person) e; String email = person.getEmail(); String name = person.getName(); StringBuilder text = new StringBuilder(); boolean hasEmail = email != null; if (hasEmail) { text.append(email); } if (name != null) { if (hasEmail) { text.append(" ("); } text.append(name); if (hasEmail) { text.append(")"); } } QName xmlName = getName(e, metadata); xw.simpleElement(xmlName.getNs(), xmlName.getLocalName(), null, text.toString()); return false; }
/** * Registers the metadata for this element. */ public static void registerMetadata(MetadataRegistry registry) { if (registry.isRegistered(KEY)) { return; } // Register superclass metadata. Person.registerMetadata(registry); registry.build(KEY); }
public void setEmail(String v) { setElement(EMAIL, (v == null) ? null : new Element(EMAIL).setTextValue(v)); } }