com.android.sdklib.internal.repository.packages
Class LayoutlibVersionMixin

java.lang.Object
  extended by com.android.sdklib.internal.repository.packages.LayoutlibVersionMixin
All Implemented Interfaces:
ILayoutlibVersion

public class LayoutlibVersionMixin
extends java.lang.Object
implements ILayoutlibVersion

Helper class to handle the layoutlib version provided by a package.


Field Summary
 
Fields inherited from interface com.android.sdklib.internal.repository.packages.ILayoutlibVersion
LAYOUTLIB_API_NOT_SPECIFIED, LAYOUTLIB_REV_NOT_SPECIFIED
 
Constructor Summary
LayoutlibVersionMixin(org.w3c.dom.Node pkgNode)
          Parses an XML node to process the <layoutlib> element.
LayoutlibVersionMixin(java.util.Properties props)
          Parses the layoutlib version optionally available in the given Properties.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 com.android.utils.Pair<java.lang.Integer,java.lang.Integer> getLayoutlibVersion()
          Returns the layoutlib version.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutlibVersionMixin

public LayoutlibVersionMixin(org.w3c.dom.Node pkgNode)
Parses an XML node to process the <layoutlib> element. The layoutlib element is new in the XSD rev 4, so we need to cope with it missing in earlier XMLs.


LayoutlibVersionMixin

public LayoutlibVersionMixin(java.util.Properties props)
Parses the layoutlib version optionally available in the given Properties.

Method Detail

getLayoutlibVersion

public com.android.utils.Pair<java.lang.Integer,java.lang.Integer> getLayoutlibVersion()
Returns the layoutlib version.

The first integer is the API of layoublib, which should be > 0. It will be equal to ILayoutlibVersion.LAYOUTLIB_API_NOT_SPECIFIED (0) if the layoutlib version isn't specified.

The second integer is the revision for that given API. It is >= 0 and works as a minor revision number, incremented for the same API level.

Specified by:
getLayoutlibVersion in interface ILayoutlibVersion
Since:
sdk-repository-4.xsd and sdk-addon-2.xsd

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object