Package com.appiancorp.suiteapi.content
Class ContentBeanFactory
java.lang.Object
com.appiancorp.suiteapi.content.ContentBeanFactory
Provides utility methods for creating content objects based on the type identifiers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassgetContentClass(Long type_) Gets the class of the content object associated with the type passed in.static ClassgetContentClass(Long type_, Long subtype_) Gets the class of the content object associated with the type and sub-type passed in.static ContentnewContent(Long type_) Creates a new Content object of the type specified.static ContentnewContent(Long type_, Long subtype_) Creates a new Content object of the type and sub-type specified.static voidsetApplicationContentSubtypeClass(int subtype_, Class customClass_) Registers the java class to be instantiated when retrieving application content objects of a given subtype.static voidsetCustomContentSubtypeClass(int subtype_, Class customClass_) Registers the java class to be instantiated when retrieving custom content objects of a given subtype.static voidsetCustomContentSubtypeClassesMap(Map subtypeToClass_) Sets all the custom content subtype class mappings.
-
Constructor Details
-
ContentBeanFactory
public ContentBeanFactory()
-
-
Method Details
-
setCustomContentSubtypeClass
Registers the java class to be instantiated when retrieving custom content objects of a given subtype. The class should extendCustomContent.- Parameters:
subtype_- The subtype of the custom content.customClass_- The class to use for custom content of this subtype.
-
setApplicationContentSubtypeClass
Registers the java class to be instantiated when retrieving application content objects of a given subtype.- Parameters:
subtype_- The subtype of the custom content.customClass_- The class to use for custom content of this subtype.
-
setCustomContentSubtypeClassesMap
Sets all the custom content subtype class mappings.- Parameters:
subtypeToClass_- A map of <Long, Class> entries, where the key is a custom content subtype, and the value is the java class to be instantiated when retrieving custom content of that subtype. The classes should extendCustomContent.
-
newContent
Creates a new Content object of the type specified. Usesnullas the sub-type.- Parameters:
type_- the type of content to create- Returns:
- the Content object
- See Also:
-
newContent
Creates a new Content object of the type and sub-type specified.- Parameters:
type_- the type of content to createsubtype_- the subtype of content to create (may benull)- Returns:
- the Content object
- See Also:
-
getContentClass
Gets the class of the content object associated with the type passed in. Each of the classes returned extendsContent.- Parameters:
type_- the content type- Returns:
- the associated class
- See Also:
-
getContentClass
Gets the class of the content object associated with the type and sub-type passed in. Each of the classes returned extendsContent.- Parameters:
type_- the content typesubtype_- the content sub-type- Returns:
- the associated class
- See Also:
-