/**
 * ADXP.java
 * <p>
 * File generated from the datatypes::ADXP uml Class
 * Generated by IHE - europe, gazelle team
 */
package net.ihe.gazelle.hl7v3.datatypes;

// End of user code
import java.io.Serial;
import java.util.List;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlTransient;
import jakarta.xml.bind.annotation.XmlType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import net.ihe.gazelle.gen.common.ConstraintValidatorModule;

import org.w3c.dom.Document;
import org.w3c.dom.Node;


/**
 * Description of the class ADXP.
 *
 * 
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ADXP", propOrder = {
	"partType"
})
@XmlRootElement(name = "ADXP")
public class ADXP extends net.ihe.gazelle.hl7v3.datatypes.ST implements java.io.Serializable {
	
	/**
	 * 
	 */
	@Serial
    private static final long serialVersionUID = 1L;

	
	/**
	 * 
	                     Specifies whether an address part names the street,
	                     city, country, postal code, post box, etc. If the type
	                     is NULL the address part is unclassified and would
	                     simply appear on an address label as is.
	                  .
	 */
	@XmlAttribute(name = "partType")
	public net.ihe.gazelle.hl7v3.voc.AddressPartType partType;
	
	/**
	 * An attribute containing marshalled element node
	 */
	@XmlTransient
	private org.w3c.dom.Node _xmlNodePresentation;
	
	
	/**
	 * Return partType.
	 * @return partType : 
	                     Specifies whether an address part names the street,
	                     city, country, postal code, post box, etc. If the type
	                     is NULL the address part is unclassified and would
	                     simply appear on an address label as is.
	                  
	 */
	public net.ihe.gazelle.hl7v3.voc.AddressPartType getPartType() {
	    return partType;
	}
	
	/**
	 * Set a value to attribute partType.
	 * @param partType : 
	                     Specifies whether an address part names the street,
	                     city, country, postal code, post box, etc. If the type
	                     is NULL the address part is unclassified and would
	                     simply appear on an address label as is.
	 */
	public void setPartType(net.ihe.gazelle.hl7v3.voc.AddressPartType partType) {
	    this.partType = partType;
	}
	
	
	
	
	
	public Node get_xmlNodePresentation() {
		if (_xmlNodePresentation == null){
				JAXBContext jc;
				DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
				dbf.setNamespaceAware(true);
				DocumentBuilder db = null;
				Document doc = null;
				try {
					db = dbf.newDocumentBuilder();
					doc = db.newDocument();
				} catch (ParserConfigurationException ignored) {}
				try {
					jc = JAXBContext.newInstance("net.ihe.gazelle.hl7v3.datatypes");
					Marshaller m = jc.createMarshaller();
					m.marshal(this, doc);
					_xmlNodePresentation = doc.getElementsByTagNameNS("urn:hl7-org:v3", "ADXP").item(0);
				} catch (JAXBException e) {
					try{
						db = dbf.newDocumentBuilder();
						_xmlNodePresentation = db.newDocument();
					}
					catch(Exception ignored){}
				}
			}
			return _xmlNodePresentation;
	}
	
	public void set_xmlNodePresentation(Node _xmlNodePresentation) {
		this._xmlNodePresentation = _xmlNodePresentation;
	}
	
	
	

	
	/**
     * validate by a module of validation
     * 
     */
   public static void validateByModule(ADXP aDXP, String _location, ConstraintValidatorModule cvm, List<net.ihe.gazelle.validation.Notification> diagnostic){
   		if (aDXP != null){
   			net.ihe.gazelle.hl7v3.datatypes.ST.validateByModule(aDXP, _location, cvm, diagnostic);
    	}
    }

}