Class DefaultTraceObjectSchema
- All Implemented Interfaces:
TraceObjectSchema,Comparable<DefaultTraceObjectSchema>
TraceObject.
These are typically loaded from XML anymore. See XmlSchemaContext. It typically consists
of a list of expected attributes and their respective schemas, some of which may be
primitive; and the schema of elements, if this is a container.
It is a bit more flexible than that, but that is the usual case. A schema may also specify one or
more interfaces it supports. An interface typically requires certain attributes, but also implies
some debugger-related behavior should be available via the target's command set. See
TraceObjectInterface and its derivatives for information about each interface.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic classNested classes/interfaces inherited from interface ghidra.trace.model.target.schema.TraceObjectSchema
TraceObjectSchema.AttributeSchema, TraceObjectSchema.Hidden, TraceObjectSchema.Private, TraceObjectSchema.SchemaName -
Method Summary
Modifier and TypeMethodDescriptionintbooleanGet the map of attribute name aliasesGet the map of attribute names to named schemasGet the context of which this schema is a memberGet the default schema for attributesGet the default schema for elementsGet the map of element indices to named schemasSet<Class<? extends TraceObjectInterface>> Get the minimum interfaces supported by a conforming objectgetName()Get the name of this schemaClass<?> getType()Get the Java class that best represents this type.inthashCode()booleanCheck if this object is the canonical container for its elementstoString()protected voidMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.trace.model.target.schema.TraceObjectSchema
checkAliasedAttribute, computeFrameLevel, filterForSuitable, getAttributeSchema, getChildSchema, getChildSchemaName, getElementSchema, getSuccessorSchema, getSuccessorSchemas, isAssignableFrom, isHidden, searchFor, searchFor, searchForAncestor, searchForAncestorContainer, searchForCanonicalContainer, searchForRegisterContainer, searchForSuitable, searchForSuitable, searchForSuitableContainer, validateRequiredAttributes, validateTypeAndInterfaces
-
Method Details
-
getContext
Description copied from interface:TraceObjectSchemaGet the context of which this schema is a memberAll schema names are resolved in this same context
- Specified by:
getContextin interfaceTraceObjectSchema- Returns:
- the context
-
getName
Description copied from interface:TraceObjectSchemaGet the name of this schema- Specified by:
getNamein interfaceTraceObjectSchema- Returns:
- the name
-
getType
Description copied from interface:TraceObjectSchemaGet the Java class that best represents this type.Note that this is either a primitive, or
TraceObject. Even though an object implementation is necessarily a sub-type ofTraceObject, for any object schema, this returnTraceObject. Information about a "sub-type" of object is communicated via interfaces, element schemas, and attribute schemas.- Specified by:
getTypein interfaceTraceObjectSchema- Returns:
- the Java class for this type
-
getInterfaces
Description copied from interface:TraceObjectSchemaGet the minimum interfaces supported by a conforming object- Specified by:
getInterfacesin interfaceTraceObjectSchema- Returns:
- the set of required interfaces
-
isCanonicalContainer
public boolean isCanonicalContainer()Description copied from interface:TraceObjectSchemaCheck if this object is the canonical container for its elementsThis is generally in reference to the default type of this object's elements. For example, if elements of this object are all expected to support the "Process" interface, then this is the canonical Process container. Any Process ought to have a (canonical) path in this container. Any other path referring to such a Process ought to be a link.
NOTE: the concept of links is still in incubation, as some native debugging APIs seem to have made it difficult to detect object identity. Additionally, it's possible a caller's first encounter with an object is not via its canonical path, and it may be difficult to assign a path having only the native-API-given object in hand.
- Specified by:
isCanonicalContainerin interfaceTraceObjectSchema- Returns:
- true if this is a canonical container, false otherwise
-
getElementSchemas
Description copied from interface:TraceObjectSchemaGet the map of element indices to named schemasIt is uncommon for this map to be populated, since the elements of a given container are typically uniform in type. Nevertheless, there can be restrictions imposed on -- and information provided for -- specific indices.
- Specified by:
getElementSchemasin interfaceTraceObjectSchema- Returns:
- the map
-
getDefaultElementSchema
Description copied from interface:TraceObjectSchemaGet the default schema for elementsSince elements of a given container are typically uniform in type, this is the primary means of specifying element schemas.
- Specified by:
getDefaultElementSchemain interfaceTraceObjectSchema- Returns:
- the default named schema
-
getAttributeSchemas
Description copied from interface:TraceObjectSchemaGet the map of attribute names to named schemasThe returned map will include aliases. To determine whether or not an attribute key is an alias, check whether the entry's key matches the name of the attribute (see
TraceObjectSchema.AttributeSchema.getName()). It is possible the schema's name is empty, i.e., the default schema. This indicates an alias to a key that was not named in the schema. UseTraceObjectSchema.getAttributeAliases()to determine the name of that key.- Specified by:
getAttributeSchemasin interfaceTraceObjectSchema- Returns:
- the map
-
getAttributeAliases
Description copied from interface:TraceObjectSchemaGet the map of attribute name aliasesThe returned map must provide the direct alias names. For any given key, the client need only query the map once to determine the name of the attribute to which the alias refers. Consequently, the map also cannot indicate a cycle.
An aliased attribute takes the value of its target implicitly.
- Specified by:
getAttributeAliasesin interfaceTraceObjectSchema- Returns:
- the map
-
getDefaultAttributeSchema
Description copied from interface:TraceObjectSchemaGet the default schema for attributesSince the expected attributes and their respective schemas are generally enumerated, this most commonly returns
TraceObjectSchema.AttributeSchema.DEFAULT_ANY, to allow unrestricted use of additional attributes, orTraceObjectSchema.AttributeSchema.DEFAULT_VOID, to forbid any additional attributes.- Specified by:
getDefaultAttributeSchemain interfaceTraceObjectSchema- Returns:
- the default attribute schema
-
toString
-
toString
-
equals
Generally speaking, object identity is sufficient for checking equality in production; however, this method is provided for testing equality between an actual and expected schema. Furthermore, this tests more for "content equality" than it does schema equivalence. In particular, if the two entries being compared come from different contexts, then, even though they may refer to child schemas by the same name, those child schemas may not be equivalent. This test will consider them "equal," even though they specify different overall schemas. Testing for true equivalence has too many nuances to consider here: What if they come from different contexts? What if they refer to different schemas, but those schemas are equivalent? etc.
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<DefaultTraceObjectSchema>
-