public class DefaultGbinTableProfile extends Object implements GbinTableProfile
Constructor and Description |
---|
DefaultGbinTableProfile()
Constructs a profile with default configuration.
|
DefaultGbinTableProfile(Class<?>[] simpleClasses,
Class<?>[] stringClasses,
Class<?>[] ignoreClasses)
Constructs a profile with explicit configuration.
|
Modifier and Type | Method and Description |
---|---|
static <T> Representation<T> |
createIdentityRepresentation(Class<T> clazz,
boolean isColumn)
Returns a representation that uses the input values unchanged.
|
Representation<?> |
createRepresentation(Class<?> clazz)
Returns an object which can represent a particular data type returned
from an accessor method of a GBIN object (or one of its descendants).
|
static Representation<String> |
createStringColumnRepresentation(Class<?> clazz)
Returns a representation that maps its input values to strings
using their toString method, and uses the result like a column.
|
String[] |
getIgnoreMethodDeclaringClasses()
This implementation returns the classnames
gaia.cu1.tools.dm.GaiaRoot and
gaia.cu1.tools.dmimpl.GaiaRootImpl . |
String[] |
getIgnoreMethodNames()
Returns the list of method names to ignore when
coming up with a list of columns for an object.
|
String |
getNameSeparator()
Returns the separation string used to delimit parts of column
hierarchical names.
|
boolean |
isHierarchicalNames()
Indicates whether column names in the output table should be forced
to reflect the compositional hierarchy of their position in the
element objects.
|
boolean |
isReadMeta()
Indicates whether non-essential metadata is read from the GBIN file.
|
boolean |
isSortedMethods()
Indicates whether object accessor method names should be
sorted alphabetically when producing the column sequence.
|
boolean |
isTestMagic()
Indicates whether the magic number is read from GBIN files before
attempting to turn them into tables.
|
public DefaultGbinTableProfile()
public DefaultGbinTableProfile(Class<?>[] simpleClasses, Class<?>[] stringClasses, Class<?>[] ignoreClasses)
simpleClasses
- list of scalar Object subclasses that
are suitable contents of a column as they standstringClasses
- list of scalar Object subclasses that
can be used as string contents of a column
by invoking their toString
methodignoreClasses
- classes which should be ignored completely
when converting to a tablepublic boolean isReadMeta()
GbinTableProfile
isReadMeta
in interface GbinTableProfile
public boolean isTestMagic()
GbinTableProfile
isTestMagic
in interface GbinTableProfile
public boolean isHierarchicalNames()
GbinTableProfile
isHierarchicalNames
in interface GbinTableProfile
public String getNameSeparator()
GbinTableProfile
getNameSeparator
in interface GbinTableProfile
public boolean isSortedMethods()
GbinTableProfile
get*
method names will be used in
whatever sequence reflection provides them in, which
according to the Class.getMethods()
javadocs
is "not sorted and are not in any particular order".isSortedMethods
in interface GbinTableProfile
public String[] getIgnoreMethodNames()
GbinTableProfile
getXxx()
or isXxx()
are used in any case.
The restrictions determined by GbinTableProfile.getIgnoreMethodDeclaringClasses()
also apply.getIgnoreMethodNames
in interface GbinTableProfile
public String[] getIgnoreMethodDeclaringClasses()
gaia.cu1.tools.dm.GaiaRoot
and
gaia.cu1.tools.dmimpl.GaiaRootImpl
.
This behaviour addresses an issue that shows up in versions of
GaiaTools 19.4.*, >=20.1.0 and >=21.0.0,
where invoking the GaiaRoot getSolutionId
method throws an exception.
The getSolutionId
method is present in all
GaiaRoot
subtypes, but in some cases no
solutionId
field is defined.
In that circumstance older GaiaTools versions simply returned
a dummy value Long.MIN_VALUE, but more recent versions throw
an exception, which caused the GbinStarTable construction to fail.
Avoiding attempts to turn the getSolutionId
method
into a GbinStarTable column can be done by checking whether
the class declaring the method is GaiaRoot/GaiaRootImpl,
as provided here. This fix was suggested by Alexander Hutton (CU1).
getIgnoreMethodDeclaringClasses
in interface GbinTableProfile
public Representation<?> createRepresentation(Class<?> clazz)
GbinTableProfile
createRepresentation
in interface GbinTableProfile
clazz
- return type of an accessor methodpublic static <T> Representation<T> createIdentityRepresentation(Class<T> clazz, boolean isColumn)
clazz
- input typeisColumn
- whether this represents a column or notpublic static Representation<String> createStringColumnRepresentation(Class<?> clazz)
clazz
- input typeCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.