Package ghidra.trace.model.target.schema
Class SchemaBuilder
java.lang.Object
ghidra.trace.model.target.schema.SchemaBuilder
A builder for a
TraceObjectSchema.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TraceObjectSchema.AttributeSchemastatic final TraceObjectSchema.SchemaName -
Constructor Summary
ConstructorsConstructorDescriptionSchemaBuilder(DefaultSchemaContext context, TraceObjectSchema schema) SchemaBuilder(DefaultSchemaContext context, TraceObjectSchema.SchemaName name) -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeAlias(String from, String to, Object origin) addAttributeSchema(TraceObjectSchema.AttributeSchema schema, Object origin) Define the schema for a child attribute.addElementSchema(String index, TraceObjectSchema.SchemaName schema, Object origin) Define the schema for a child elementaddInterface(Class<? extends TraceObjectInterface> iface) build()getAttributeSchema(String name) Set<Class<? extends TraceObjectInterface>> Class<?> getType()booleanremoveAttributeSchema(String name) removeElementSchema(String index) removeInterface(Class<? extends TraceObjectInterface> iface) replaceAttributeAlias(String from, String to, Object origin) replaceAttributeSchema(TraceObjectSchema.AttributeSchema schema, Object origin) setCanonicalContainer(boolean isCanonicalContainer) setDefaultAttributeSchema(TraceObjectSchema.AttributeSchema defaultAttributeSchema) setDefaultElementSchema(TraceObjectSchema.SchemaName defaultElementSchema) setInterfaces(Set<Class<? extends TraceObjectInterface>> interfaces) protected voidvalidateAlias(String from, String to)
-
Field Details
-
DEFAULT_ELEMENT_SCHEMA
-
DEFAULT_ATTRIBUTE_SCHEMA
-
-
Constructor Details
-
SchemaBuilder
-
SchemaBuilder
-
-
Method Details
-
setType
-
getType
-
setInterfaces
-
getInterfaces
-
addInterface
-
removeInterface
-
setCanonicalContainer
-
isCanonicalContaineration
public boolean isCanonicalContaineration() -
addElementSchema
public SchemaBuilder addElementSchema(String index, TraceObjectSchema.SchemaName schema, Object origin) Define the schema for a child element- Parameters:
index- the index whose schema to define, or "" for the defaultschema- the schema defining the elementorigin- optional, for diagnostics, an object describing the element schema's origin- Returns:
- this builder
-
removeElementSchema
-
getElementSchemas
-
setDefaultElementSchema
-
getDefaultElementSchema
-
addAttributeSchema
Define the schema for a child attribute.If the attribute schema's name is empty, the given schema becomes the default attribute schema.
- Parameters:
schema- the attribute schema to add to the definitionorigin- optional, for diagnostics, an object describing the attribute schema's origin- Returns:
- this builder
-
removeAttributeSchema
-
getAttributeSchemas
-
getAttributeSchema
-
replaceAttributeSchema
public SchemaBuilder replaceAttributeSchema(TraceObjectSchema.AttributeSchema schema, Object origin) -
validateAlias
-
addAttributeAlias
-
replaceAttributeAlias
-
setDefaultAttributeSchema
public SchemaBuilder setDefaultAttributeSchema(TraceObjectSchema.AttributeSchema defaultAttributeSchema) -
getDefaultAttributeSchema
-
buildAndAdd
-
buildAndReplace
-
build
-