View Javadoc
1   package org.synchronoss.cpo.jdbc;
2   
3   /*-
4    * [[
5    * jdbc
6    * ==
7    * Copyright (C) 2003 - 2026 Exaxis LLC, Synchronoss Technologies Inc
8    * ==
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   *
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   *
19   * You should have received a copy of the GNU General Lesser Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * ]]
23   */
24  
25  import java.io.Serial;
26  import org.synchronoss.cpo.core.meta.domain.CpoArgument;
27  
28  /**
29   * JdbcCpoArgument is a class that defines the arguments to a JDBC expression
30   *
31   * @author david berry
32   */
33  public class JdbcCpoArgument extends CpoArgument implements java.io.Serializable, Cloneable {
34  
35    /** Version Id for this class. */
36    @Serial private static final long serialVersionUID = 1L;
37  
38    private static final String IN_PARAMETER = "IN";
39    private static final String OUT_PARAMETER = "OUT";
40    private static final String INOUT_PARAMETER = "BOTH";
41  
42    /** The parameter scope of this argument: {@code IN}, {@code OUT}, or {@code BOTH}. */
43    private String scope = null;
44  
45    /** The native (JDBC-specific) type info for this argument. */
46    private String typeInfo = null;
47  
48    /** Construct a JdbcCpoArgument */
49    public JdbcCpoArgument() {
50      super();
51    }
52  
53    /** {@inheritDoc} */
54    @Override
55    public JdbcCpoAttribute getAttribute() {
56      return (JdbcCpoAttribute) super.getAttribute();
57    }
58  
59    /**
60     * Is this attribute an IN parameter
61     *
62     * @return true if this attribute is an IN parameter
63     */
64    public boolean isInParameter() {
65      return IN_PARAMETER.equals(getScope()) || INOUT_PARAMETER.equals(getScope());
66    }
67  
68    /**
69     * Is this attribute an OUT parameter
70     *
71     * @return true if this attribute is an OUT parameter
72     */
73    public boolean isOutParameter() {
74      return OUT_PARAMETER.equals(getScope()) || INOUT_PARAMETER.equals(getScope());
75    }
76  
77    /**
78     * Gets the scope of this argument
79     *
80     * @return The scope
81     */
82    public String getScope() {
83      return scope;
84    }
85  
86    /**
87     * Sets this arguments scope
88     *
89     * @param scope - The scope of the argument
90     */
91    public void setScope(String scope) {
92      this.scope = scope;
93    }
94  
95    /**
96     * Get the type info for this argument
97     *
98     * @return The type info for this argument
99     */
100   public String getTypeInfo() {
101     return typeInfo;
102   }
103 
104   /**
105    * Sets the type info for this argument
106    *
107    * @param typeInfo - The type info to set
108    */
109   public void setTypeInfo(String typeInfo) {
110     this.typeInfo = typeInfo;
111   }
112 }