com.android.ide.common.res2
Class DataBindingResourceItem

java.lang.Object
  extended by com.android.ide.common.res2.DataBindingResourceItem

public abstract class DataBindingResourceItem
extends java.lang.Object


Constructor Summary
DataBindingResourceItem(java.lang.String name, DataBindingResourceType type)
          Constructs the object with a name, type and optional value.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.io.File getFile()
          For non-values resources, this is the original source file.
 java.lang.String getKey()
          Returns the key for this item.
 java.lang.String getName()
          Returns the name of the item.
 F getSource()
          Returns the DataFile the item is coming from.
protected  int getStatus()
          Obtains the full status of the data item; should not generally be used except for debug purposes.
 DataBindingResourceType getType()
           
 int hashCode()
           
 void setSource(F sourceFile)
          Sets the DataFile.
protected  void wasTouched()
          Hook invoked when the data item has been touched.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataBindingResourceItem

public DataBindingResourceItem(@NonNull
                               java.lang.String name,
                               @NonNull
                               DataBindingResourceType type)
Constructs the object with a name, type and optional value.

Note that the object is not fully usable as-is. It must be added to a DataFile first.

Parameters:
name - the name of the item
Method Detail

getType

@NonNull
public DataBindingResourceType getType()

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

getName

@NonNull
public java.lang.String getName()
Returns the name of the item.


getSource

@Nullable
public F getSource()
Returns the DataFile the item is coming from.


setSource

public void setSource(@NonNull
                      F sourceFile)
Sets the DataFile. The item must not belong to a data file.

Parameters:
sourceFile - the data file, if null then the item is marked as being removed from the data file

getStatus

protected int getStatus()
Obtains the full status of the data item; should not generally be used except for debug purposes.

Returns:
the internal representation

getKey

public java.lang.String getKey()
Returns the key for this item. They key uniquely identifies this item.


wasTouched

protected void wasTouched()
Hook invoked when the data item has been touched. The default implementation does nothing.


getFile

public java.io.File getFile()
For non-values resources, this is the original source file. This method is here as GeneratedResourceItem overrides it.