Java - How to set String as static int
<p>I have a method that accepts only a String.</p>

<pre><code>public void setVerticalAlignment(String align) {
            ...
    gd.verticalAlignment = align;   // accepts only int.
            ...
}
</code></pre>

<p>But <code>gd.verticalAlignment</code> only accepts an int. 
Usually this is set by something like <code>gd.verticalAlignment = SWT.TOP</code> where SWT.TOP is a static int.</p>

<p>is it possible to call this method with something like <code>setVerticalAlignment("SWT.TOP")</code>?</p>
