📄 clusterimpl.java
字号:
/** * This class was generated from a set of XML constraints * by the Enhydra Zeus XML Data Binding Framework. All * source code in this file is constructed specifically * to work with other Zeus-generated classes. If you * modify this file by hand, you run the risk of breaking * this interoperation, as well as introducing errors in * source code compilation. * * * * * * MODIFY THIS FILE AT YOUR OWN RISK * * * * * * * To find out more about the Enhydra Zeus framework, you * can point your browser at <http://zeus.enhydra.org> * where you can download releases, join and discuss Zeus * on user and developer mailing lists, and access source * code. Please report any bugs through that website. */package edu.tsinghua.lumaqq.xml.groups;// Global Implementation Import Statementsimport java.io.*;import java.util.HashMap;import java.util.Iterator;import java.util.Map;import org.xml.sax.EntityResolver;import org.xml.sax.ErrorHandler;import org.xml.sax.InputSource;import org.xml.sax.Locator;import org.xml.sax.SAXException;import org.xml.sax.SAXParseException;import org.xml.sax.XMLReader;import org.xml.sax.ext.LexicalHandler;import org.xml.sax.helpers.DefaultHandler;import org.xml.sax.helpers.XMLReaderFactory;// Local Implementation Import Statementsimport java.util.List;import java.util.LinkedList;public class ClusterImpl extends DefaultHandler implements Cloneable, Unmarshallable, LexicalHandler, Cluster { private List FriendList; private String name; private boolean zeus_NameSet; private String category; private boolean zeus_CategorySet; private String creator; private boolean zeus_CreatorSet; private String externalId; private boolean zeus_ExternalIdSet; private String authType; private boolean zeus_AuthTypeSet; private String face; private boolean zeus_FaceSet; private String type; private boolean zeus_TypeSet; private String notice; private boolean zeus_NoticeSet; private String description; private boolean zeus_DescriptionSet; private String clusterId; private boolean zeus_ClusterIdSet; private String message; private static boolean zeus_MessageInitialized; private static java.util.Vector zeus_validMessage; private boolean zeus_MessageSet; /** Any DOCTYPE reference/statements. */ private String docTypeString; /** The encoding for the output document */ private String outputEncoding; /** The current node in unmarshalling */ private Unmarshallable zeus_currentUNode; /** The parent node in unmarshalling */ private Unmarshallable zeus_parentUNode; /** Whether this node has been handled */ private boolean zeus_thisNodeHandled = false; /** Whether a DTD exists for an unmarshal call */ private boolean hasDTD; /** Whether validation is occurring */ private boolean validate; /** The namespace mappings on this element */ private Map namespaceMappings; /** The EntityResolver for SAX parsing to use */ private static EntityResolver entityResolver; /** The ErrorHandler for SAX parsing to use */ private static ErrorHandler errorHandler; private static ClusterImpl prototype = null; public static void setPrototype(ClusterImpl prototype) { ClusterImpl.prototype = prototype; } public static ClusterImpl newInstance() { try { return (prototype!=null)?(ClusterImpl)prototype.clone(): new ClusterImpl(); } catch (CloneNotSupportedException e) { return null; // never } } public ClusterImpl() { FriendList = new LinkedList(); zeus_NameSet = false; zeus_CategorySet = false; zeus_CreatorSet = false; zeus_ExternalIdSet = false; zeus_AuthTypeSet = false; zeus_FaceSet = false; zeus_TypeSet = false; zeus_NoticeSet = false; zeus_DescriptionSet = false; zeus_ClusterIdSet = false; zeus_MessageInitialized = false; zeus_validMessage = null; zeus_MessageSet = false; docTypeString = ""; hasDTD = false; validate = false; namespaceMappings = new HashMap(); } public List getFriendList() { return FriendList; } public void setFriendList(List FriendList) { this.FriendList = FriendList; } public void addFriend(Friend Friend) { FriendList.add(Friend); } public void removeFriend(Friend Friend) { FriendList.remove(Friend); } public String getName() { if(name == null) return ""; else return name; } public void setName(String name) { this.name = name; zeus_NameSet = true; } public String getCategory() { if(category == null) return ""; else return category; } public void setCategory(String category) { this.category = category; zeus_CategorySet = true; } public String getCreator() { if(creator == null) return ""; else return creator; } public void setCreator(String creator) { this.creator = creator; zeus_CreatorSet = true; } public String getExternalId() { if(externalId == null) return ""; else return externalId; } public void setExternalId(String externalId) { this.externalId = externalId; zeus_ExternalIdSet = true; } public String getAuthType() { if(authType == null) return ""; else return authType; } public void setAuthType(String authType) { this.authType = authType; zeus_AuthTypeSet = true; } public String getFace() { if(face == null) return ""; else return face; } public void setFace(String face) { this.face = face; zeus_FaceSet = true; } public String getType() { if(type == null) return ""; else return type; } public void setType(String type) { this.type = type; zeus_TypeSet = true; } public String getNotice() { if(notice == null) return ""; else return notice; } public void setNotice(String notice) { this.notice = notice; zeus_NoticeSet = true; } public String getDescription() { if(description == null) return ""; else return description; } public void setDescription(String description) { this.description = description; zeus_DescriptionSet = true; } public String getClusterId() { if(clusterId == null) return ""; else return clusterId; } public void setClusterId(String clusterId) { this.clusterId = clusterId; zeus_ClusterIdSet = true; } public String getMessage() { if(message == null) return ""; else return message; } public void setMessage(String message) throws IllegalArgumentException { if (!zeus_MessageInitialized) { zeus_validMessage = new java.util.Vector(); zeus_validMessage.addElement("accept"); zeus_validMessage.addElement("eject"); zeus_validMessage.addElement("shownumber"); zeus_validMessage.addElement("record"); zeus_validMessage.addElement("block"); zeus_MessageInitialized = true; } if (!zeus_validMessage.contains(message)) { throw new IllegalArgumentException("Illegal value for attribute 'message'"); } else { this.message = message; this.zeus_MessageSet = true; } } public void setDocType(String name, String publicID, String systemID) { try { startDTD(name, publicID, systemID); } catch (SAXException neverHappens) { } } public void setOutputEncoding(String outputEncoding) { this.outputEncoding = outputEncoding; } public void marshal(File file) throws IOException { // Delegate to the marshal(Writer) method if (outputEncoding != null) { marshal(new OutputStreamWriter(new FileOutputStream(file), outputEncoding)); } else { marshal(new OutputStreamWriter(new FileOutputStream(file), "utf-8")); } } public void marshal(OutputStream outputStream) throws IOException { // Delegate to the marshal(Writer) method if (outputEncoding != null) { marshal(new OutputStreamWriter(outputStream, outputEncoding)); } else { marshal(new OutputStreamWriter(outputStream, "utf-8")); } } public void marshal(Writer writer) throws IOException { // Write out the XML declaration writer.write("<?xml version=\"1.0\" "); if (outputEncoding != null) { writer.write("encoding=\""); writer.write(outputEncoding); writer.write("\"?>\n\n"); } else { writer.write("encoding=\"UTF-8\"?>\n\n"); } // Handle DOCTYPE declaration writer.write(docTypeString); writer.write("\n"); // Now start the recursive writing writeXMLRepresentation(writer, ""); // Close up writer.flush(); writer.close(); } protected void writeXMLRepresentation(Writer writer, String indent) throws IOException { writer.write(indent); writer.write("<Cluster"); // Handle namespace mappings (if needed) for (Iterator i = namespaceMappings.keySet().iterator(); i.hasNext(); ) { String prefix = (String)i.next(); String uri = (String)namespaceMappings.get(prefix); writer.write(" xmlns"); if (!prefix.trim().equals("")) { writer.write(":"); writer.write(prefix); } writer.write("=\""); writer.write(uri); writer.write("\"\n "); } // Handle attributes (if needed) if (zeus_NameSet) { writer.write(" name=\""); writer.write(escapeAttributeValue(name)); writer.write("\""); } if (zeus_CategorySet) { writer.write(" category=\""); writer.write(escapeAttributeValue(category)); writer.write("\""); } if (zeus_CreatorSet) { writer.write(" creator=\""); writer.write(escapeAttributeValue(creator)); writer.write("\""); } if (zeus_ExternalIdSet) { writer.write(" externalId=\""); writer.write(escapeAttributeValue(externalId)); writer.write("\""); } if (zeus_AuthTypeSet) { writer.write(" authType=\""); writer.write(escapeAttributeValue(authType)); writer.write("\""); } if (zeus_FaceSet) { writer.write(" face=\""); writer.write(escapeAttributeValue(face)); writer.write("\""); } if (zeus_TypeSet) { writer.write(" type=\""); writer.write(escapeAttributeValue(type)); writer.write("\""); } if (zeus_NoticeSet) { writer.write(" notice=\""); writer.write(escapeAttributeValue(notice)); writer.write("\""); } if (zeus_DescriptionSet) { writer.write(" description=\""); writer.write(escapeAttributeValue(description)); writer.write("\""); } if (zeus_ClusterIdSet) { writer.write(" clusterId=\""); writer.write(escapeAttributeValue(clusterId)); writer.write("\""); } if (zeus_MessageSet) { writer.write(" message=\""); writer.write(escapeAttributeValue(message)); writer.write("\""); } writer.write(">"); writer.write("\n"); // Handle child elements for (Iterator i=FriendList.iterator(); i.hasNext(); ) { FriendImpl friend = (FriendImpl)i.next(); friend.writeXMLRepresentation(writer, new StringBuffer(indent).append(" ").toString()); } writer.write(indent); writer.write("</Cluster>\n");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -