FileDocCategorySizeDatePackage
Movie.javaAPI DocExample8940Sun Jul 07 09:31:54 BST 2002javajaxb.generated.movies

Movie

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

Fields Summary
private String
_Title
private javajaxb.generated.movies.Cast
_Cast
private String
_Director
private List
_Producer
private javax.xml.bind.PredicatedLists.Predicate
pred_Producer
Constructors Summary
Methods Summary
public voiddeleteProducer()

        _Producer = null;
        invalidate();
    
public voidemptyProducer()

        _Producer = PredicatedLists.createInvalidating(this, pred_Producer, new ArrayList());
    
public booleanequals(java.lang.Object ob)

        if (this == ob) {
            return true;
        }
        if (!(ob instanceof Movie)) {
            return false;
        }
        Movie tob = ((Movie) ob);
        if (_Title!= null) {
            if (tob._Title == null) {
                return false;
            }
            if (!_Title.equals(tob._Title)) {
                return false;
            }
        } else {
            if (tob._Title!= null) {
                return false;
            }
        }
        if (_Cast!= null) {
            if (tob._Cast == null) {
                return false;
            }
            if (!_Cast.equals(tob._Cast)) {
                return false;
            }
        } else {
            if (tob._Cast!= null) {
                return false;
            }
        }
        if (_Director!= null) {
            if (tob._Director == null) {
                return false;
            }
            if (!_Director.equals(tob._Director)) {
                return false;
            }
        } else {
            if (tob._Director!= null) {
                return false;
            }
        }
        if (_Producer!= null) {
            if (tob._Producer == null) {
                return false;
            }
            if (!_Producer.equals(tob._Producer)) {
                return false;
            }
        } else {
            if (tob._Producer!= null) {
                return false;
            }
        }
        return true;
    
public javajaxb.generated.movies.CastgetCast()

        return _Cast;
    
public java.lang.StringgetDirector()

        return _Director;
    
public java.util.ListgetProducer()

        return _Producer;
    
public java.lang.StringgetTitle()


       
        return _Title;
    
public inthashCode()

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

        XMLWriter w = m.writer();
        w.start("movie");
        w.leaf("title", _Title.toString());
        m.marshal(_Cast);
        if (_Director!= null) {
            w.leaf("director", _Director.toString());
        }
        for (Iterator i = _Producer.iterator(); i.hasNext(); ) {
            w.leaf("producer", ((String) i.next()).toString());
        }
        w.end("movie");
    
public static javax.xml.bind.DispatchernewDispatcher()

        return Actor.newDispatcher();
    
public voidsetCast(javajaxb.generated.movies.Cast _Cast)

        this._Cast = _Cast;
        if (_Cast == null) {
            invalidate();
        }
    
public voidsetDirector(java.lang.String _Director)

        this._Director = _Director;
        if (_Director == null) {
            invalidate();
        }
    
public voidsetTitle(java.lang.String _Title)

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

        StringBuffer sb = new StringBuffer("<<movie");
        if (_Title!= null) {
            sb.append(" title=");
            sb.append(_Title.toString());
        }
        if (_Cast!= null) {
            sb.append(" cast=");
            sb.append(_Cast.toString());
        }
        if (_Director!= null) {
            sb.append(" director=");
            sb.append(_Director.toString());
        }
        if (_Producer!= null) {
            sb.append(" producer=");
            sb.append(_Producer.toString());
        }
        sb.append(">>");
        return sb.toString();
    
public voidunmarshal(javax.xml.bind.Unmarshaller u)

        XMLScanner xs = u.scanner();
        Validator v = u.validator();
        xs.takeStart("movie");
        while (xs.atAttribute()) {
            String an = xs.takeAttributeName();
            throw new InvalidAttributeException(an);
        }
        if (xs.atStart("title")) {
            xs.takeStart("title");
            String s;
            if (xs.atChars(XMLScanner.WS_COLLAPSE)) {
                s = xs.takeChars(XMLScanner.WS_COLLAPSE);
            } else {
                s = "";
            }
            try {
                _Title = String.valueOf(s);
            } catch (Exception x) {
                throw new ConversionException("title", x);
            }
            xs.takeEnd("title");
        }
        _Cast = ((Cast) u.unmarshal());
        if (xs.atStart("director")) {
            xs.takeStart("director");
            String s;
            if (xs.atChars(XMLScanner.WS_COLLAPSE)) {
                s = xs.takeChars(XMLScanner.WS_COLLAPSE);
            } else {
                s = "";
            }
            try {
                _Director = String.valueOf(s);
            } catch (Exception x) {
                throw new ConversionException("director", x);
            }
            xs.takeEnd("director");
        }
        {
            List l = new ArrayList();
            while (xs.atStart()) {
                if (xs.atStart("producer")) {
                    xs.takeStart("producer");
                    String s;
                    if (xs.atChars(XMLScanner.WS_COLLAPSE)) {
                        s = xs.takeChars(XMLScanner.WS_COLLAPSE);
                    } else {
                        s = "";
                    }
                    String uf;
                    try {
                        uf = String.valueOf(s);
                    } catch (Exception x) {
                        throw new ConversionException("producer", x);
                    }
                    l.add(uf);
                    xs.takeEnd("producer");
                } else {
                    break;
                }
            }
            _Producer = PredicatedLists.createInvalidating(this, pred_Producer, l);
        }
        xs.takeEnd("movie");
    
public static javajaxb.generated.movies.Movieunmarshal(java.io.InputStream in)

        return unmarshal(XMLScanner.open(in));
    
public static javajaxb.generated.movies.Movieunmarshal(javax.xml.marshal.XMLScanner xs)

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

        return ((Movie) d.unmarshal(xs, (Movie.class)));
    
public voidvalidate(javax.xml.bind.Validator v)

        v.validate(_Cast);
    
public voidvalidateThis()

        if (_Title == null) {
            throw new MissingContentException("title");
        }
        if (_Cast == null) {
            throw new MissingContentException("cast");
        }