title: How declare a variable within a predefined java class, `View`, without creating a new class which extends the java class `View`?
body: <p>I am trying to add a variable within the class <code>View</code>, that I can reference in subViews like Button, Label etc.</p>
  
  <p>I have done this successfully in Swift, but having trouble in Java. This is what it looks like in Swift. </p>
  
  <p><a href="https://i.stack.imgur.com/xnXFc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xnXFc.png" alt="Swift code to add variable without creating custom view"></a></p>
  
  <p>This code allows me to set <code>styleName</code> within all views that extend <code>UIView</code>. Allowing me to remove redundant custom views. Eg. <code>myButton.styleName = "Hello World"</code></p>
  
  <p>I have seen that <code>extension</code> is not possible. As seen <a href="https://stackoverflow.com/questions/4359979/java-equivalent-to-c-sharp-extension-methods">here</a>. Not sure if there is another way to achieve this. Thanks in advance!</p>