FileDocCategorySizeDatePackage
Host.javaAPI DocExample4910Sun Jul 07 09:43:06 BST 2002javajaxb.generated.config

Host

public class Host extends javax.xml.bind.MarshallableObject implements Element

Fields Summary
private String
_Hostname
private String
_Port
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object ob)

        if (this == ob) {
            return true;
        }
        if (!(ob instanceof Host)) {
            return false;
        }
        Host tob = ((Host) ob);
        if (_Hostname!= null) {
            if (tob._Hostname == null) {
                return false;
            }
            if (!_Hostname.equals(tob._Hostname)) {
                return false;
            }
        } else {
            if (tob._Hostname!= null) {
                return false;
            }
        }
        if (_Port!= null) {
            if (tob._Port == null) {
                return false;
            }
            if (!_Port.equals(tob._Port)) {
                return false;
            }
        } else {
            if (tob._Port!= null) {
                return false;
            }
        }
        return true;
    
public java.lang.StringgetHostname()

        return _Hostname;
    
public java.lang.StringgetPort()

        return _Port;
    
public inthashCode()

        int h = 0;
        h = ((127 *h)+((_Hostname!= null)?_Hostname.hashCode(): 0));
        h = ((127 *h)+((_Port!= null)?_Port.hashCode(): 0));
        return h;
    
public voidmarshal(javax.xml.bind.Marshaller m)

        XMLWriter w = m.writer();
        w.start("host");
        w.attribute("hostname", _Hostname.toString());
        w.attribute("port", _Port.toString());
        w.end("host");
    
public static javax.xml.bind.DispatchernewDispatcher()

        return Connection.newDispatcher();
    
public voidsetHostname(java.lang.String _Hostname)

        this._Hostname = _Hostname;
        if (_Hostname == null) {
            invalidate();
        }
    
public voidsetPort(java.lang.String _Port)

        this._Port = _Port;
        if (_Port == null) {
            invalidate();
        }
    
public java.lang.StringtoString()

        StringBuffer sb = new StringBuffer("<<host");
        if (_Hostname!= null) {
            sb.append(" hostname=");
            sb.append(_Hostname.toString());
        }
        if (_Port!= null) {
            sb.append(" port=");
            sb.append(_Port.toString());
        }
        sb.append(">>");
        return sb.toString();
    
public static javajaxb.generated.config.Hostunmarshal(javax.xml.marshal.XMLScanner xs)

        return unmarshal(xs, newDispatcher());
    
public static javajaxb.generated.config.Hostunmarshal(javax.xml.marshal.XMLScanner xs, javax.xml.bind.Dispatcher d)

        return ((Host) d.unmarshal(xs, (Host.class)));
    
public voidunmarshal(javax.xml.bind.Unmarshaller u)

        XMLScanner xs = u.scanner();
        Validator v = u.validator();
        xs.takeStart("host");
        while (xs.atAttribute()) {
            String an = xs.takeAttributeName();
            if (an.equals("hostname")) {
                if (_Hostname!= null) {
                    throw new DuplicateAttributeException(an);
                }
                _Hostname = xs.takeAttributeValue();
                continue;
            }
            if (an.equals("port")) {
                if (_Port!= null) {
                    throw new DuplicateAttributeException(an);
                }
                _Port = xs.takeAttributeValue();
                continue;
            }
            throw new InvalidAttributeException(an);
        }
        xs.takeEnd("host");
    
public static javajaxb.generated.config.Hostunmarshal(java.io.InputStream in)

        return unmarshal(XMLScanner.open(in));
    
public voidvalidate(javax.xml.bind.Validator v)

    
public voidvalidateThis()

        if (_Hostname == null) {
            throw new MissingAttributeException("hostname");
        }
        if (_Port == null) {
            throw new MissingAttributeException("port");
        }