public class ObjectConverterUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ObjectConverter |
createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses)
Creates
ObjectConverter , with ignoreDuplicates = false, which means that when there are two annotated beans with the same
value for Node.jcrType() , an IllegalArgumentException is thrown. |
static ObjectConverter |
createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses,
boolean ignoreDuplicates)
Creates
ObjectConverter . |
static ObjectConverter |
createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses,
Class<? extends HippoBean>[] builtInMappingClasses,
String[] fallbackNodeTypes,
boolean ignoreDuplicates)
Creates
ObjectConverter . |
static List<Class<? extends HippoBean>> |
getAnnotatedClasses(ClasspathResourceScanner resourceScanner,
String... locationPatterns)
Collects bean classes annotated by
Node
from the location specified by locationPattern . |
static List<Class<? extends HippoBean>> |
getAnnotatedClasses(URL url)
Deprecated.
since HSTTWO 2.30.01
|
static String[] |
getDefaultFallbackNodeTypes()
Returns the default built-in fallback jcr primary node types
|
public static ObjectConverter createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses) throws IllegalArgumentException
ObjectConverter
, with ignoreDuplicates = false, which means that when there are two annotated beans with the same
value for Node.jcrType()
, an IllegalArgumentException is thrown.annotatedClasses
- Annotated class mapping against jcr primary node types.annotatedClasses
IllegalArgumentException
- when two annotatedClasses have the same Node.jcrType()
public static ObjectConverter createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses, boolean ignoreDuplicates) throws IllegalArgumentException
ObjectConverter
.annotatedClasses
- Annotated class mapping against jcr primary node types.ignoreDuplicates
- Flag whether duplicate mapping for a node type is ignored or not. If it is false, it throws IllegalArgumentException
on duplicate mappings.annotatedClasses
IllegalArgumentException
- when two annotatedClasses have the same Node.jcrType()
and ignoreDuplicates
is falsepublic static ObjectConverter createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses, Class<? extends HippoBean>[] builtInMappingClasses, String[] fallbackNodeTypes, boolean ignoreDuplicates) throws IllegalArgumentException
ObjectConverter
.annotatedClasses
- Annotated class mapping against jcr primary node types.builtInMappingClasses
- Built-in class mappings against the default built-in jcr primary node types.fallbackNodeTypes
- If no bean found for the node type, a fallback node type is to be selected as ordered by using node.isNodeType(fallbackNodeType)
ignoreDuplicates
- Flag whether duplicate mapping for a node type is ignored or not. If it is false, it throws IllegalArgumentException
on duplicate mappings.IllegalArgumentException
public static String[] getDefaultFallbackNodeTypes()
@Deprecated public static List<Class<? extends HippoBean>> getAnnotatedClasses(URL url) throws IOException, SAXException, ParserConfigurationException
Node
from a XML Resource URL.
Each annotated class name must be written inside <annotated-class/>
element
as child of the root element, <hst-content-beans/>,
like the following example:
org.hippoecm.hst.demo.beans.TextBean org.hippoecm.hst.demo.beans.NewsBean org.hippoecm.hst.demo.beans.ProductBean org.hippoecm.hst.demo.beans.CommentBean org.hippoecm.hst.demo.beans.CommentLinkBean org.hippoecm.hst.demo.beans.ImageLinkBean
url
- IOException
SAXException
ParserConfigurationException
public static List<Class<? extends HippoBean>> getAnnotatedClasses(ClasspathResourceScanner resourceScanner, String... locationPatterns) throws IOException, SAXException, ParserConfigurationException
Node
from the location specified by locationPattern
.
Class resources will be collected by the specified resourceScanner
.resourceScanner
- locationPatterns
- IOException
SAXException
ParserConfigurationException
ClasspathResourceScanner}
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.