T
- the type of values that the content type is used forpublic class ContentType<T> extends java.lang.Object implements IType<T>
Data values of the same content type should be able share a single axis in a graph.
Modifier and Type | Field and Description |
---|---|
private java.util.List<DisplayFormatter<T>> |
m_formatters |
protected java.lang.String |
m_identifier |
private java.lang.String |
m_localizedName |
Constructor and Description |
---|
ContentType(java.lang.String identifier) |
ContentType(java.lang.String identifier,
java.lang.String localizedName) |
Modifier and Type | Method and Description |
---|---|
protected void |
addFormatter(DisplayFormatter<T> formatter) |
<M> IMemberAccessor<M,T> |
getAccessor(IAccessorKey<M> attribute)
Internal low-level mechanism for retrieving a member accessor for a type, or null if not
available.
|
java.util.Map<IAccessorKey<?>,? extends IDescribable> |
getAccessorKeys()
Get keys for the accessors that this type knows of.
|
java.util.List<IAttribute<?>> |
getAttributes() |
IFormatter<T> |
getDefaultFormatter() |
java.lang.String |
getDescription() |
IFormatter<T> |
getFormatter(java.lang.String formatterIdentifier) |
java.util.List<DisplayFormatter<T>> |
getFormatters() |
java.lang.String |
getIdentifier()
String identifying the type.
|
java.lang.String |
getName() |
IPersister<T> |
getPersister() |
boolean |
hasAttribute(ICanonicalAccessorFactory<?> attribute)
|
protected static java.lang.String |
lookupNameFor(java.lang.String typeIdentifier) |
java.lang.String |
toString() |
private final java.util.List<DisplayFormatter<T>> m_formatters
protected final java.lang.String m_identifier
private final java.lang.String m_localizedName
ContentType(java.lang.String identifier)
public ContentType(java.lang.String identifier, java.lang.String localizedName)
protected void addFormatter(DisplayFormatter<T> formatter)
public java.util.List<DisplayFormatter<T>> getFormatters()
public IFormatter<T> getDefaultFormatter()
public java.lang.String getName()
getName
in interface IDescribable
public java.lang.String getIdentifier()
IType
getIdentifier
in interface IType<T>
public IPersister<T> getPersister()
public IFormatter<T> getFormatter(java.lang.String formatterIdentifier)
public java.lang.String getDescription()
getDescription
in interface IDescribable
public java.util.List<IAttribute<?>> getAttributes()
getAttributes
in interface IType<T>
public java.util.Map<IAccessorKey<?>,? extends IDescribable> getAccessorKeys()
IType
Should only be used for low level type inspection. Iterators etc. should use a collection of
predefined attributes
.
getAccessorKeys
in interface IType<T>
public boolean hasAttribute(ICanonicalAccessorFactory<?> attribute)
IType
attribute
can return an accessor
for this type
. This method is semantically equivalent to
attribute.getAccessor(type)
!= null
,
but may be cheaper.hasAttribute
in interface IType<T>
attribute
- attribute to checktrue
if the attribute can return an accessor for this type, false
if
notpublic <M> IMemberAccessor<M,T> getAccessor(IAccessorKey<M> attribute)
IType
This is only intended to be used by implementors of IAccessorFactory
. All other usage
should be replaced with ICanonicalAccessorFactory.getAccessor(IType)
call to pre-defined accessors.
getAccessor
in interface IType<T>
M
- accessor value typeattribute
- the identifier for the fieldpublic java.lang.String toString()
toString
in class java.lang.Object
protected static java.lang.String lookupNameFor(java.lang.String typeIdentifier)