Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType > Class Template Reference

#include <DocumentSchema.h>

Inherits AZ::DocumentPropertyEditor::AttributeDefinitionInterface.

Public Member Functions

constexpr AttributeDefinition (AZStd::string_view name)
 
Name GetName () const override
 Retrieves the name of this attribute, as used as a key in the DOM.
 
virtual Dom::Value ValueToDom (const AttributeType &attribute) const
 Converts a value of this attribute's type to a DOM value.
 
virtual AZStd::optional< AttributeType > DomToValue (const Dom::Value &value) const
 Converts a DOM value to an instance of AttributeType.
 
AZStd::optional< AttributeType > ExtractFromDomNode (const Dom::Value &node) const
 Extracts this value from a given Node, if this attribute is set there.
 
AZ::TypeId GetTypeId () const override
 Gets this attribute's type ID.
 
AZStd::shared_ptr< AZ::Attribute > DomValueToLegacyAttribute (const AZ::Dom::Value &value, bool fallback) const override
 
AZ::Dom::Value LegacyAttributeToDomValue (void *instance, AZ::Attribute *attribute) const override
 
virtual Name GetName () const =0
 Retrieves the name of this attribute, as used as a key in the DOM.
 
virtual AZ::TypeId GetTypeId () const =0
 Gets this attribute's type ID.
 
virtual AZStd::shared_ptr< AZ::Attribute > DomValueToLegacyAttribute (const AZ::Dom::Value &value, bool fallback=true) const =0
 
virtual AZ::Dom::Value LegacyAttributeToDomValue (void *instance, AZ::Attribute *attribute) const =0
 

Protected Attributes

AZStd::fixed_string< 128 > m_name
 

Detailed Description

template<typename AttributeType>
class AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType >

Defines an attribute applicable to a Node. Attributes may be defined inline inside of a NodeDefinition. AttributeDefinitions may be used to marshal types to and from a DOM representation. This representation is not guaranteed to be serializable - for functions and complex types they may be stored as non-serializeable opaque types in the DOM.

Member Function Documentation

◆ DomToValue()

template<typename AttributeType >
virtual AZStd::optional< AttributeType > AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType >::DomToValue ( const Dom::Value &  value) const
inlinevirtual

◆ DomValueToLegacyAttribute()

template<typename AttributeType >
AZStd::shared_ptr< AZ::Attribute > AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType >::DomValueToLegacyAttribute ( const AZ::Dom::Value &  value,
bool  fallback 
) const
inlineoverridevirtual

Converts this attribute to an AZ::Attribute usable by the ReflectedPropertyEditor

Parameters
fallbackif false, the Attribute type must match AZ::Dom::Value; if true, it will attempt a fallback on failure

Implements AZ::DocumentPropertyEditor::AttributeDefinitionInterface.

◆ GetName()

template<typename AttributeType >
Name AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType >::GetName ( ) const
inlineoverridevirtual

Retrieves the name of this attribute, as used as a key in the DOM.

Implements AZ::DocumentPropertyEditor::AttributeDefinitionInterface.

◆ GetTypeId()

template<typename AttributeType >
AZ::TypeId AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType >::GetTypeId ( ) const
inlineoverridevirtual

Gets this attribute's type ID.

Implements AZ::DocumentPropertyEditor::AttributeDefinitionInterface.

◆ LegacyAttributeToDomValue()

template<typename AttributeType >
AZ::Dom::Value AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType >::LegacyAttributeToDomValue ( void *  instance,
AZ::Attribute *  attribute 
) const
inlineoverridevirtual

Converts this attribute from an AZ::Attribute to a Dom::Value usable in the DocumentPropertyEditor.

Parameters
fallbackif false, a Read<AttributeType> failure will return a null Value; if true, it will attempt a fallback on failure

Implements AZ::DocumentPropertyEditor::AttributeDefinitionInterface.

◆ ValueToDom()

template<typename AttributeType >
virtual Dom::Value AZ::DocumentPropertyEditor::AttributeDefinition< AttributeType >::ValueToDom ( const AttributeType &  attribute) const
inlinevirtual

The documentation for this class was generated from the following file: