1c3ab0d6aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3c3ab0d6aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4c3ab0d6aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5c3ab0d6aSAndrew Rist  * distributed with this work for additional information
6c3ab0d6aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7c3ab0d6aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8c3ab0d6aSAndrew Rist  * "License"); you may not use this file except in compliance
9c3ab0d6aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10c3ab0d6aSAndrew Rist  *
11c3ab0d6aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12c3ab0d6aSAndrew Rist  *
13c3ab0d6aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14c3ab0d6aSAndrew Rist  * software distributed under the License is distributed on an
15c3ab0d6aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c3ab0d6aSAndrew Rist  * KIND, either express or implied.  See the License for the
17c3ab0d6aSAndrew Rist  * specific language governing permissions and limitations
18c3ab0d6aSAndrew Rist  * under the License.
19c3ab0d6aSAndrew Rist  *
20c3ab0d6aSAndrew Rist  *************************************************************/
21c3ab0d6aSAndrew Rist 
22c3ab0d6aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package connectivity.tools;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import com.sun.star.beans.PropertyVetoException;
27cdf0e10cSrcweir import com.sun.star.beans.UnknownPropertyException;
28cdf0e10cSrcweir import com.sun.star.beans.XPropertySet;
29cdf0e10cSrcweir import com.sun.star.lang.WrappedTargetException;
30cdf0e10cSrcweir import com.sun.star.lang.IllegalArgumentException;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir public class QueryDefinition
33cdf0e10cSrcweir {
34cdf0e10cSrcweir     XPropertySet    m_queryDef;
35cdf0e10cSrcweir 
QueryDefinition( XPropertySet _queryDef )36cdf0e10cSrcweir     public QueryDefinition( XPropertySet _queryDef )
37cdf0e10cSrcweir     {
38cdf0e10cSrcweir         m_queryDef = _queryDef;
39cdf0e10cSrcweir     }
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     /** retrieves the command underlying the query definition
42cdf0e10cSrcweir      *
43cdf0e10cSrcweir      * This method is a mere wrapped around the <code>getPropertyValue( "Command" )</code> call
44cdf0e10cSrcweir      */
getCommand()45cdf0e10cSrcweir     public final String getCommand() throws WrappedTargetException
46cdf0e10cSrcweir     {
47cdf0e10cSrcweir         String command = null;
48cdf0e10cSrcweir         try {
49cdf0e10cSrcweir             command = (String)m_queryDef.getPropertyValue( "Command" );
50cdf0e10cSrcweir         }
51cdf0e10cSrcweir         catch (UnknownPropertyException e) { }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir         return command;
54cdf0e10cSrcweir     }
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     /** retrieves the command underlying the query definition
57cdf0e10cSrcweir      *
58cdf0e10cSrcweir      * This method is a mere wrapped around the <code>getPropertyValue( "Command" )</code> call
59cdf0e10cSrcweir      */
setCommand( String _command )60cdf0e10cSrcweir     public void setCommand( String _command ) throws WrappedTargetException
61cdf0e10cSrcweir     {
62cdf0e10cSrcweir         try
63cdf0e10cSrcweir         {
64cdf0e10cSrcweir             m_queryDef.setPropertyValue( "Command", _command );
65cdf0e10cSrcweir         }
66cdf0e10cSrcweir         catch (UnknownPropertyException e) { }
67cdf0e10cSrcweir         catch (PropertyVetoException e) { }
68cdf0e10cSrcweir         catch (IllegalArgumentException e) { }
69cdf0e10cSrcweir     }
70*170fb961SPedro Giffuni }
71