001: package net.sourceforge.squirrel_sql.plugins.mysql.prefs;
002:
003: /*
004: * Copyright (C) 2007 Rob Manning
005: * manningr@users.sourceforge.net
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: */
021: import java.io.Serializable;
022:
023: import net.sourceforge.squirrel_sql.fw.preferences.IQueryTokenizerPreferenceBean;
024:
025: /**
026: * A bean class to store preferences for the Oracle plugin.
027: */
028: public class MysqlPreferenceBean implements Cloneable, Serializable,
029: IQueryTokenizerPreferenceBean {
030:
031: static final long serialVersionUID = 5818886723165356478L;
032:
033: static final String UNSUPPORTED = "Unsupported";
034:
035: /** Client Name. */
036: private String _clientName;
037:
038: /** Client version. */
039: private String _clientVersion;
040:
041: private String statementSeparator = ";";
042:
043: private String procedureSeparator = "|";
044:
045: private String lineComment = "--";
046:
047: private boolean removeMultiLineComments = false;
048:
049: private boolean installCustomQueryTokenizer = true;
050:
051: public MysqlPreferenceBean() {
052: super ();
053: }
054:
055: /**
056: * Return a copy of this object.
057: */
058: public Object clone() {
059: try {
060: return super .clone();
061: } catch (CloneNotSupportedException ex) {
062: throw new InternalError(ex.getMessage()); // Impossible.
063: }
064: }
065:
066: /**
067: * Retrieve the client to use. This is only
068: * used if <TT>useAnonymousClient</TT> is false.
069: *
070: * @return Client name.
071: */
072: public String getClientName() {
073: return _clientName;
074: }
075:
076: /**
077: * Set the client name.
078: *
079: * @param value Client name
080: */
081: public void setClientName(String value) {
082: _clientName = value;
083: }
084:
085: /**
086: * Retrieve the client version to use. This is only
087: * used if <TT>useAnonymousLogon</TT> is false.
088: *
089: * @return Client version.
090: */
091: public String getClientVersion() {
092: return _clientVersion;
093: }
094:
095: /**
096: * Set the client version.
097: *
098: * @param value Client version
099: */
100: public void setClientVersion(String value) {
101: _clientVersion = value;
102: }
103:
104: /**
105: * @param statementSeparator the statementSeparator to set
106: */
107: public void setStatementSeparator(String statementSeparator) {
108: this .statementSeparator = statementSeparator;
109: }
110:
111: /**
112: * @return the statementSeparator
113: */
114: public String getStatementSeparator() {
115: return statementSeparator;
116: }
117:
118: /**
119: * @param procedureSeparator the procedureSeparator to set
120: */
121: public void setProcedureSeparator(String procedureSeparator) {
122: this .procedureSeparator = procedureSeparator;
123: }
124:
125: /**
126: * @return the procedureSeparator
127: */
128: public String getProcedureSeparator() {
129: return procedureSeparator;
130: }
131:
132: /**
133: * @param lineComment the lineComment to set
134: */
135: public void setLineComment(String lineComment) {
136: this .lineComment = lineComment;
137: }
138:
139: /**
140: * @return the lineComment
141: */
142: public String getLineComment() {
143: return lineComment;
144: }
145:
146: /**
147: * @param removeMultiLineComments the removeMultiLineComments to set
148: */
149: public void setRemoveMultiLineComments(
150: boolean removeMultiLineComments) {
151: this .removeMultiLineComments = removeMultiLineComments;
152: }
153:
154: /**
155: * @return the removeMultiLineComments
156: */
157: public boolean isRemoveMultiLineComments() {
158: return removeMultiLineComments;
159: }
160:
161: /**
162: * @param installCustomQueryTokenizer the installCustomQueryTokenizer to set
163: */
164: public void setInstallCustomQueryTokenizer(
165: boolean installCustomQueryTokenizer) {
166: this .installCustomQueryTokenizer = installCustomQueryTokenizer;
167: }
168:
169: /**
170: * @return the installCustomQueryTokenizer
171: */
172: public boolean isInstallCustomQueryTokenizer() {
173: return installCustomQueryTokenizer;
174: }
175:
176: }
|