Package deltix.qsrv.hf.pub.md
Class ClassDescriptor
- java.lang.Object
-
- deltix.qsrv.hf.pub.md.NamedDescriptor
-
- deltix.qsrv.hf.pub.md.ClassDescriptor
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ClassDescriptor>
- Direct Known Subclasses:
EnumClassDescriptor
,ExtendableClassDescriptor
public abstract class ClassDescriptor extends NamedDescriptor implements java.io.Serializable, java.lang.Comparable<ClassDescriptor>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassDescriptor.GuidNotFoundException
static interface
ClassDescriptor.TypeResolver
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<ClassDescriptor>
ASCENDING_COMPARATOR
static char
ASSEMBLY_SEPARATOR
protected java.lang.String
guid
Unique identifier of this class.static int
T_ENUM
static int
T_RECORD
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClassDescriptor()
protected
ClassDescriptor(ClassDescriptor from)
protected
ClassDescriptor(java.lang.Class<?> cls)
protected
ClassDescriptor(java.lang.Class<?> cls, ClassAnnotator annotator)
protected
ClassDescriptor(java.lang.String name, java.lang.String title)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ClassDescriptor o)
static java.lang.String
createGuid()
boolean
dependsOn(ClassDescriptor cd)
static java.util.List<ClassDescriptor>
depSort(ClassDescriptor[] cds)
Sorts the supplied array of class descriptors so that all dependent classes precede the classes that depend on them.boolean
equals(java.lang.Object obj)
static java.lang.String[]
extractGuids(ClassDescriptor[] cds)
static java.lang.String
getClassNameWithAssembly(java.lang.Class<?> cls)
ClassDescriptor[]
getDependencies()
java.lang.String
getGuid()
int
hashCode()
static boolean
isDotNet(java.lang.String className)
boolean
isEquals(ClassDescriptor target)
java.lang.Object
newInstanceNoX(TypeLoader loader)
protected void
readFields(java.io.DataInputStream in, int serial)
protected void
readFields(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial)
protected void
readFieldsWithoutGuid(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial)
static ClassDescriptor
readFrom(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial)
static ClassDescriptor
readFrom(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial, java.util.Map<java.lang.String,ClassDescriptor> cache)
static ClassDescriptor
readReference(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver)
boolean
visitDependencies(deltix.util.collections.Visitor<ClassDescriptor> out)
void
writeReference(java.io.DataOutputStream out)
void
writeTo(java.io.DataOutputStream out, int serial)
-
Methods inherited from class deltix.qsrv.hf.pub.md.NamedDescriptor
getDescription, getName, getTitle, setDescription
-
-
-
-
Field Detail
-
T_RECORD
public static final int T_RECORD
- See Also:
- Constant Field Values
-
T_ENUM
public static final int T_ENUM
- See Also:
- Constant Field Values
-
ASSEMBLY_SEPARATOR
public static final char ASSEMBLY_SEPARATOR
- See Also:
- Constant Field Values
-
ASCENDING_COMPARATOR
public static final java.util.Comparator<ClassDescriptor> ASCENDING_COMPARATOR
-
guid
protected java.lang.String guid
Unique identifier of this class.
-
-
Constructor Detail
-
ClassDescriptor
protected ClassDescriptor(java.lang.String name, java.lang.String title)
-
ClassDescriptor
protected ClassDescriptor()
-
ClassDescriptor
protected ClassDescriptor(java.lang.Class<?> cls)
-
ClassDescriptor
protected ClassDescriptor(ClassDescriptor from)
-
ClassDescriptor
protected ClassDescriptor(java.lang.Class<?> cls, ClassAnnotator annotator)
-
-
Method Detail
-
depSort
public static java.util.List<ClassDescriptor> depSort(ClassDescriptor[] cds)
Sorts the supplied array of class descriptors so that all dependent classes precede the classes that depend on them. An attempt is made to keep the classes sorted in alphabetical order, as long as it does not contradict to quasi-ordering by dependency. This algorithm is deterministic. It will add missing dependencies to the output list.- Parameters:
cds
- An array of classes to sort/augment.- Returns:
- A sorted/augmented list.
-
createGuid
public static java.lang.String createGuid()
-
compareTo
public int compareTo(ClassDescriptor o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ClassDescriptor>
-
getClassNameWithAssembly
public static java.lang.String getClassNameWithAssembly(java.lang.Class<?> cls)
-
getGuid
public java.lang.String getGuid()
-
isDotNet
public static boolean isDotNet(java.lang.String className)
-
newInstanceNoX
public java.lang.Object newInstanceNoX(TypeLoader loader)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
isEquals
public boolean isEquals(ClassDescriptor target)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
dependsOn
public boolean dependsOn(ClassDescriptor cd)
-
visitDependencies
public boolean visitDependencies(deltix.util.collections.Visitor<ClassDescriptor> out)
-
getDependencies
public final ClassDescriptor[] getDependencies()
-
extractGuids
public static java.lang.String[] extractGuids(ClassDescriptor[] cds)
-
writeReference
public void writeReference(java.io.DataOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
readReference
public static ClassDescriptor readReference(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver) throws java.io.IOException
- Throws:
java.io.IOException
-
writeTo
public void writeTo(java.io.DataOutputStream out, int serial) throws java.io.IOException
- Overrides:
writeTo
in classNamedDescriptor
- Throws:
java.io.IOException
-
readFields
protected final void readFields(java.io.DataInputStream in, int serial) throws java.io.IOException
- Overrides:
readFields
in classNamedDescriptor
- Throws:
java.io.IOException
-
readFields
protected void readFields(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial) throws java.io.IOException
- Throws:
java.io.IOException
-
readFieldsWithoutGuid
protected void readFieldsWithoutGuid(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial) throws java.io.IOException
- Throws:
java.io.IOException
-
readFrom
public static ClassDescriptor readFrom(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial) throws java.io.IOException
- Throws:
java.io.IOException
-
readFrom
public static ClassDescriptor readFrom(java.io.DataInputStream in, ClassDescriptor.TypeResolver resolver, int serial, java.util.Map<java.lang.String,ClassDescriptor> cache) throws java.io.IOException
- Throws:
java.io.IOException
-
-