package javajaxb.generated.movies;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.bind.ConversionException;
import javax.xml.bind.Dispatcher;
import javax.xml.bind.DuplicateAttributeException;
import javax.xml.bind.Element;
import javax.xml.bind.InvalidAttributeException;
import javax.xml.bind.LocalValidationException;
import javax.xml.bind.MarshallableObject;
import javax.xml.bind.Marshaller;
import javax.xml.bind.StructureValidationException;
import javax.xml.bind.UnmarshalException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.Validator;
import javax.xml.marshal.XMLScanner;
import javax.xml.marshal.XMLWriter;
public class Actor
extends MarshallableObject
implements Element
{
private String _Headliner;
private boolean isDefaulted_Headliner = true;
private final static String DEFAULT_HEADLINER = String.valueOf("false");
private String _Content;
public boolean defaultedHeadliner() {
return (_Headliner!= null);
}
public String getHeadliner() {
if (_Headliner == null) {
return DEFAULT_HEADLINER;
}
return _Headliner;
}
public void setHeadliner(String _Headliner) {
this._Headliner = _Headliner;
if (_Headliner == null) {
invalidate();
}
}
public String getContent() {
return _Content;
}
public void setContent(String _Content) {
this._Content = _Content;
if (_Content == null) {
invalidate();
}
}
public void validateThis()
throws LocalValidationException
{
}
public void validate(Validator v)
throws StructureValidationException
{
}
public void marshal(Marshaller m)
throws IOException
{
XMLWriter w = m.writer();
w.start("actor");
if (_Headliner!= null) {
w.attribute("headliner", _Headliner.toString());
}
if (_Content!= null) {
w.chars(_Content.toString());
}
w.end("actor");
}
public void unmarshal(Unmarshaller u)
throws UnmarshalException
{
XMLScanner xs = u.scanner();
Validator v = u.validator();
xs.takeStart("actor");
while (xs.atAttribute()) {
String an = xs.takeAttributeName();
if (an.equals("headliner")) {
if (_Headliner!= null) {
throw new DuplicateAttributeException(an);
}
_Headliner = xs.takeAttributeValue();
continue;
}
throw new InvalidAttributeException(an);
}
{
String s;
if (xs.atChars(XMLScanner.WS_COLLAPSE)) {
s = xs.takeChars(XMLScanner.WS_COLLAPSE);
} else {
s = "";
}
try {
_Content = String.valueOf(s);
} catch (Exception x) {
throw new ConversionException("content", x);
}
}
xs.takeEnd("actor");
}
public static Actor unmarshal(InputStream in)
throws UnmarshalException
{
return unmarshal(XMLScanner.open(in));
}
public static Actor unmarshal(XMLScanner xs)
throws UnmarshalException
{
return unmarshal(xs, newDispatcher());
}
public static Actor unmarshal(XMLScanner xs, Dispatcher d)
throws UnmarshalException
{
return ((Actor) d.unmarshal(xs, (Actor.class)));
}
public boolean equals(Object ob) {
if (this == ob) {
return true;
}
if (!(ob instanceof Actor)) {
return false;
}
Actor tob = ((Actor) ob);
if (_Headliner!= null) {
if (tob._Headliner == null) {
return false;
}
if (!_Headliner.equals(tob._Headliner)) {
return false;
}
} else {
if (tob._Headliner!= null) {
return false;
}
}
if (_Content!= null) {
if (tob._Content == null) {
return false;
}
if (!_Content.equals(tob._Content)) {
return false;
}
} else {
if (tob._Content!= null) {
return false;
}
}
return true;
}
public int hashCode() {
int h = 0;
h = ((127 *h)+((_Headliner!= null)?_Headliner.hashCode(): 0));
h = ((127 *h)+((_Content!= null)?_Content.hashCode(): 0));
return h;
}
public String toString() {
StringBuffer sb = new StringBuffer("<<actor");
sb.append(" headliner=");
sb.append(getHeadliner().toString());
if (_Content!= null) {
sb.append(" content=");
sb.append(_Content.toString());
}
sb.append(">>");
return sb.toString();
}
public static Dispatcher newDispatcher() {
Dispatcher d = new Dispatcher();
d.register("actor", (Actor.class));
d.register("cast", (Cast.class));
d.register("movie", (Movie.class));
d.register("movies", (Movies.class));
d.freezeElementNameMap();
return d;
}
}
|