Package tigase.server
Class ComponentInfo
- java.lang.Object
-
- tigase.server.ComponentInfo
-
public class ComponentInfo extends Object
Helper class for storing and handling additional informations about components- Author:
- Wojciech Kapcia
-
-
Constructor Summary
Constructors Constructor Description ComponentInfo(Class<?> c)Creates ComponentInfo object with initial dataComponentInfo(String cmpName, Class<?> c)Creates ComponentInfo object with initial dataComponentInfo(String cmpTitle, String cmpVersion, String cmpCls)Creates ComponentInfo object with initial dataComponentInfo(String cmpName, String cmpTitle, String cmpVersion, String cmpCls)Creates ComponentInfo object with initial dataComponentInfo(String cmpName, String cmpTitle, String cmpVersion, String cmpCls, HashMap<String,Object> cmpData)Creates ComponentInfo object with initial data
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetComponentClass()Allows retrieving of component's classHashMap<String,Object>getComponentData()Allows retrieving of component's additional dataStringgetComponentTitle()Allows retrieving of component's titleStringgetComponentVersion()Allows retrieving of component's versionstatic PackagegetImplementation(Class<?> c)Allows retrieving implementation package (obtained from jar package) for a given classstatic StringgetImplementationInfo(Class<?> c)Allows retrieving implementation information (obtained from jar package) for a given classstatic StringgetImplementationTitle(Class<?> c)Allows retrieving implementation title (obtained from jar package) for a given classstatic StringgetImplementationVersion(Class<?> c)Allows retrieving implementation version (obtained from jar package) for a given classstatic Optional<Version>getImplementationVersion(String... classes)StringgetName()Allows retrieving of component's namestatic Optional<ComponentInfo>of(String className)ElementtoElement()Allows retrieving of component's information as ElementStringtoString()
-
-
-
Constructor Detail
-
ComponentInfo
public ComponentInfo(String cmpTitle, String cmpVersion, String cmpCls)
Creates ComponentInfo object with initial data- Parameters:
cmpTitle- title of the componentcmpVersion- version of the componentcmpCls- class of the component
-
ComponentInfo
public ComponentInfo(String cmpName, String cmpTitle, String cmpVersion, String cmpCls)
Creates ComponentInfo object with initial data- Parameters:
cmpName- name of the componentcmpTitle- title of the componentcmpVersion- version of the componentcmpCls- class of the component
-
ComponentInfo
public ComponentInfo(String cmpName, String cmpTitle, String cmpVersion, String cmpCls, HashMap<String,Object> cmpData)
Creates ComponentInfo object with initial data- Parameters:
cmpName- name of the componentcmpTitle- title of the componentcmpVersion- version of the componentcmpCls- class of the componentcmpData- additional information about component
-
ComponentInfo
public ComponentInfo(Class<?> c)
Creates ComponentInfo object with initial data- Parameters:
c- class of the component
-
-
Method Detail
-
getImplementation
public static Package getImplementation(Class<?> c)
Allows retrieving implementation package (obtained from jar package) for a given class- Parameters:
c- class for which package is to be retrieved- Returns:
- package containing given class
-
getImplementationInfo
public static String getImplementationInfo(Class<?> c)
Allows retrieving implementation information (obtained from jar package) for a given class- Parameters:
c- class for which Package information is to be retrieved- Returns:
- title and version of the Package holding class
-
getImplementationTitle
public static String getImplementationTitle(Class<?> c)
Allows retrieving implementation title (obtained from jar package) for a given class- Parameters:
c- class for which Package title is to be retrieved- Returns:
- Package title of the given class
-
getImplementationVersion
public static Optional<Version> getImplementationVersion(String... classes)
-
getImplementationVersion
public static String getImplementationVersion(Class<?> c)
Allows retrieving implementation version (obtained from jar package) for a given class- Parameters:
c- class for which Package version is to be retrieved- Returns:
- Package version of the given class
-
of
public static Optional<ComponentInfo> of(String className)
-
getName
public String getName()
Allows retrieving of component's name- Returns:
- component name
-
getComponentTitle
public String getComponentTitle()
Allows retrieving of component's title- Returns:
- component title
-
getComponentVersion
public String getComponentVersion()
Allows retrieving of component's version- Returns:
- component version
-
getComponentClass
public String getComponentClass()
Allows retrieving of component's class- Returns:
- component class
-
getComponentData
public HashMap<String,Object> getComponentData()
Allows retrieving of component's additional data- Returns:
- component additional data
-
toElement
public Element toElement()
Allows retrieving of component's information as Element- Returns:
- component information as Element
-
-