Class AXmlAttribute<T>
java.lang.Object
soot.jimple.infoflow.android.axml.AXmlElement
soot.jimple.infoflow.android.axml.AXmlAttribute<T>
- Type Parameters:
T- determines the attribute's type. CurrentlyInteger,BooleanandStringare supported.
Represents an attribute of an Android XML node.
- Author:
- Stefan Haas, Mario Schlipf, Steven Arzt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe attribute's name.protected intThe attribute's resource idprotected intThe attribute's typeprotected TThe attribute's value.Fields inherited from class soot.jimple.infoflow.android.axml.AXmlElement
added, include -
Constructor Summary
ConstructorsConstructorDescriptionAXmlAttribute(String name, int resourceId, int type, T value, String ns, boolean added) AXmlAttribute(String name, int resourceId, T value, String ns) Creates a newAXmlAttributeobject with the givenname,valueandnamespace.
Theadddedflag is defaulted to true (seeAXmlElement.added).AXmlAttribute(String name, int resourceId, T value, String ns, boolean added) AXmlAttribute(String name, T value, String ns) Creates a newAXmlAttributeobject with the givenname,valueandnamespace.
Theadddedflag is defaulted to true (seeAXmlElement.added). -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets this value as a Boolean.booleanasBoolean(ARSCFileParser arscParser) Gets this value as a Boolean.intGets this value as an integer value.intasInteger(ARSCFileParser arscParser) Gets this value as an integer value.asString()Gets this value as a string.asString(ARSCFileParser arscParser) Gets this value as a string.booleanintReturns an integer which identifies this attribute's type.getName()Returns the name of this attribute.intGets the resource id of this attribute.intgetType()Returns an integer which identifies this attribute's type.getValue()Returns the value of this attribute.inthashCode()voidSets the value for this attribute.toString()Methods inherited from class soot.jimple.infoflow.android.axml.AXmlElement
exclude, getNamespace, include, include, isAdded, isIncluded, setAdded, setNamespace
-
Field Details
-
name
The attribute's name. -
type
protected int typeThe attribute's type -
value
The attribute's value. -
resourceId
protected int resourceIdThe attribute's resource id
-
-
Constructor Details
-
AXmlAttribute
Creates a newAXmlAttributeobject with the givenname,valueandnamespace.
Theadddedflag is defaulted to true (seeAXmlElement.added).- Parameters:
name- the attribute's name.value- the attribute's value.ns- the attribute's namespace.
-
AXmlAttribute
Creates a newAXmlAttributeobject with the givenname,valueandnamespace.
Theadddedflag is defaulted to true (seeAXmlElement.added).- Parameters:
name- the attribute's name.resourceId- the attribute's resource id.value- the attribute's value.ns- the attribute's namespace.
-
AXmlAttribute
- Parameters:
name- the attribute's name.resourceId- the attribute's resource id.value- the attribute's value.ns- the attribute's namespace.added- wheter this attribute was part of a parsed xml file or added afterwards.
-
AXmlAttribute
- Parameters:
name- the attribute's name.resourceId- the attribute's resource id.type- the attribute's typevalue- the attribute's value.ns- the attribute's namespace.added- wheter this attribute was part of a parsed xml file or added afterwards.
-
-
Method Details
-
getName
Returns the name of this attribute.- Returns:
- the attribute's name.
-
getResourceId
public int getResourceId()Gets the resource id of this attribute.- Returns:
- the attribute's resource id.
-
setValue
Sets the value for this attribute.- Parameters:
value- the new value.
-
getValue
Returns the value of this attribute.- Returns:
- the attribute's value.
-
getType
public int getType()Returns an integer which identifies this attribute's type. Currently if AXmlAttribute is typed asIntegerthis will returnNodeVisitor.TYPE_INT_HEX, typedBooleanwill result inNodeVisitor.TYPE_INT_BOOLEANand otherwise (even if not typed asString) this returnsNodeVisitor.TYPE_STRING.- Returns:
- integer representing the attribute's type
- See Also:
-
NodeVisitor.TYPE_INT_HEXNodeVisitor.TYPE_INT_BOOLEANNodeVisitor.TYPE_STRING
-
getAttributeType
public int getAttributeType()Returns an integer which identifies this attribute's type. This is the type originally passed to the constructor.- Returns:
- integer representing the attribute's type
- See Also:
-
NodeVisitor.TYPE_INT_HEXNodeVisitor.TYPE_INT_BOOLEANNodeVisitor.TYPE_STRING
-
toString
-
asBoolean
public boolean asBoolean()Gets this value as a Boolean. This function only looks at the immediate value and does not resolve references.- Returns:
- This value as a Boolean.
-
asBoolean
Gets this value as a Boolean. If this value is a reference to a resource, a lookup is performed.- Parameters:
arscParser- The ARSC parser for resource lookups- Returns:
- This value as a Boolean.
-
asString
Gets this value as a string. This function only looks at the immediate value and does not resolve references.- Returns:
- This value as a string
-
asString
Gets this value as a string. If this value is a reference to a resource, a lookup is performed.- Parameters:
arscParser- The ARSC parser for resource lookups- Returns:
- This value as a string
-
asInteger
public int asInteger()Gets this value as an integer value. This function only looks at the immediate value and does not resolve references.- Returns:
- This value as an integer value
-
asInteger
Gets this value as an integer value. If this value is a reference to a resource, a lookup is performed.- Parameters:
arscParser- The ARSC parser for resource lookups- Returns:
- This value as an integer value
-
hashCode
public int hashCode() -
equals
-