1 22 23 package org.xquark.schema; 24 25 public final class ContentModel implements SchemaConstants, SchemaVisitable { 26 private static final String RCSRevision = "$Revision: 1.1 $"; 27 private static final String RCSName = "$Name: $"; 28 29 private Object model = null; 30 private int contentType; 31 32 public ContentModel() { 33 contentType = EMPTY; 34 model = null; 35 } 36 37 public ContentModel(int type) { 38 contentType = type; 39 model = null; 40 } 41 42 public ContentModel(SimpleType model) { 43 contentType = TEXT_ONLY; 44 setModel(model); 45 } 46 47 public ContentModel(Particle model) { 48 this(model, ELEMENT_ONLY); 49 } 50 51 public ContentModel(Particle model, int contentType) { 52 this.contentType = contentType; 53 setModel(model); 54 } 55 56 public void accept(SchemaVisitor visitor) throws SchemaException { 57 visitor.visit(this); 58 } 59 60 public int getContentType() { 61 return contentType; 62 } 63 64 public void setContentType(int contentType) { 65 this.contentType = contentType; 66 } 67 68 public Object getModel() { 69 return model; 70 } 71 72 public void setModel(Object model) { 73 this.model = model; 74 } 75 76 void initModel(Object model) { 77 this.model = model; 78 102 } 103 104 } 105 | Popular Tags |