📄 loginimpl.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.logins;
// Global Implementation Import Statements
import 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;
public class LoginImpl extends DefaultHandler implements Cloneable, Unmarshallable, LexicalHandler, Login {
private String rememberPassword;
private static boolean zeus_RememberPasswordInitialized;
private static java.util.Vector zeus_validRememberPassword;
private boolean zeus_RememberPasswordSet;
private String qq;
private boolean zeus_QqSet;
private String password;
private boolean zeus_PasswordSet;
private String loginHidden;
private static boolean zeus_LoginHiddenInitialized;
private static java.util.Vector zeus_validLoginHidden;
private boolean zeus_LoginHiddenSet;
/** 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 LoginImpl prototype = null;
public static void setPrototype(LoginImpl prototype) {
LoginImpl.prototype = prototype;
}
public static LoginImpl newInstance() {
try {
return (prototype!=null)?(LoginImpl)prototype.clone(): new LoginImpl();
} catch (CloneNotSupportedException e) {
return null; // never
}
}
public LoginImpl() {
zeus_RememberPasswordInitialized = false;
zeus_validRememberPassword = null;
zeus_RememberPasswordSet = false;
zeus_QqSet = false;
zeus_PasswordSet = false;
zeus_LoginHiddenInitialized = false;
zeus_validLoginHidden = null;
zeus_LoginHiddenSet = false;
docTypeString = "";
hasDTD = false;
validate = false;
namespaceMappings = new HashMap();
}
public String getRememberPassword() {
return rememberPassword;
}
public void setRememberPassword(String rememberPassword)
throws IllegalArgumentException {
if (!zeus_RememberPasswordInitialized) {
zeus_validRememberPassword = new java.util.Vector();
zeus_validRememberPassword.addElement("true");
zeus_validRememberPassword.addElement("false");
zeus_RememberPasswordInitialized = true;
}
if (!zeus_validRememberPassword.contains(rememberPassword)) {
throw new IllegalArgumentException("Illegal value for attribute 'rememberPassword'");
} else {
this.rememberPassword = rememberPassword;
this.zeus_RememberPasswordSet = true;
}
}
public String getQq() {
return qq;
}
public void setQq(String qq) {
this.qq = qq;
zeus_QqSet = true;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
zeus_PasswordSet = true;
}
public String getLoginHidden() {
return loginHidden;
}
public void setLoginHidden(String loginHidden)
throws IllegalArgumentException {
if (!zeus_LoginHiddenInitialized) {
zeus_validLoginHidden = new java.util.Vector();
zeus_validLoginHidden.addElement("true");
zeus_validLoginHidden.addElement("false");
zeus_LoginHiddenInitialized = true;
}
if (!zeus_validLoginHidden.contains(loginHidden)) {
throw new IllegalArgumentException("Illegal value for attribute 'loginHidden'");
} else {
this.loginHidden = loginHidden;
this.zeus_LoginHiddenSet = 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("<Login");
// 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_RememberPasswordSet) {
writer.write(" rememberPassword=\"");
writer.write(escapeAttributeValue(rememberPassword));
writer.write("\"");
}
if (zeus_QqSet) {
writer.write(" qq=\"");
writer.write(escapeAttributeValue(qq));
writer.write("\"");
}
if (zeus_PasswordSet) {
writer.write(" password=\"");
writer.write(escapeAttributeValue(password));
writer.write("\"");
}
if (zeus_LoginHiddenSet) {
writer.write(" loginHidden=\"");
writer.write(escapeAttributeValue(loginHidden));
writer.write("\"");
}
writer.write("/>\n");
}
private String escapeAttributeValue(String attributeValue) {
String returnValue = attributeValue;
for (int i = 0; i < returnValue.length(); i++) {
char ch = returnValue.charAt(i);
if (ch < 0x20) {
if ( (ch != 0x09) && (ch != 0x0a) && (ch != 0x0d) ) {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append(' ')
.append(returnValue.substring(i+1))
.toString();
}
} else if (ch == '"') {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append(""")
.append(returnValue.substring(i+1))
.toString();
} else if (ch == '&') {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append("&")
.append(returnValue.substring(i+1))
.toString();
} else if (ch == '>') {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append(">")
.append(returnValue.substring(i+1))
.toString();
} else if (ch == '<') {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append("<")
.append(returnValue.substring(i+1))
.toString();
}
}
return returnValue;
}
private String escapeTextValue(String textValue) {
String returnValue = textValue;
for (int i = 0; i < returnValue.length(); i++) {
char ch = returnValue.charAt(i);
if (ch < 0x20) {
if ( (ch != 0x09) && (ch != 0x0a) && (ch != 0x0d) ) {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append(' ')
.append(returnValue.substring(i+1))
.toString();
}
} else if (ch == '<') {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append("<")
.append(returnValue.substring(i+1))
.toString();
} else if (ch == '&') {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
.append("&")
.append(returnValue.substring(i+1))
.toString();
} else if (ch == '>') {
returnValue = new StringBuffer()
.append(returnValue.substring(0, i))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -