Class Component<T extends Component<T>>
- java.lang.Object
-
- org.devacfr.maven.skins.reflow.snippet.Component<T>
-
- Type Parameters:
T- type of component
- Direct Known Subclasses:
SnippetComponent
public class Component<T extends Component<T>> extends Object
Base of Snippet component.- Version:
- 2.4
- Author:
- Christophe Friederich
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedComponent(org.jsoup.nodes.Node node)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TaddAttribute(org.jsoup.nodes.Attribute attr)protected TaddAttributes(org.jsoup.nodes.Attributes attrs)TaddChild(Component<?> component)static Component<?>createComponent(org.jsoup.nodes.Node node, Component<?> parent)Objectget(String name)Map<String,String>getAriaAttributes()StringgetAttribute(String name)Map<String,String>getAttrs()ComponentsgetChildren()ComponentsgetChildren(String name)Map<String,String>getDataAttributes()protected org.jsoup.nodes.ElementgetElement()StringgetHtml()StringgetName()StringgetOwnHtml()Component<?>getParent()protected SnippetComponent<?>getRootParent()booleanhasAttribute(String name)booleanisHtmlTag()protected Tself()StringtoString()protected TwithParent(Component<?> parent)
-
-
-
Constructor Detail
-
Component
protected Component(@Nonnull org.jsoup.nodes.Node node)
- Parameters:
node- a node (can not benull).
-
-
Method Detail
-
createComponent
public static Component<?> createComponent(@Nonnull org.jsoup.nodes.Node node, Component<?> parent)
- Parameters:
node- a node (can not benull).parent- the parent component- Returns:
- the created component
-
getName
public String getName()
- Returns:
- the name
-
isHtmlTag
public boolean isHtmlTag()
- Returns:
-
getHtml
public String getHtml()
- Returns:
- the html content
-
getOwnHtml
public String getOwnHtml()
- Returns:
-
getParent
public Component<?> getParent()
- Returns:
- the parent
-
getElement
@Nullable protected org.jsoup.nodes.Element getElement()
-
get
public Object get(@Nonnull String name)
- Parameters:
name- the name- Returns:
- the attribute or child component value
-
hasAttribute
public boolean hasAttribute(String name)
-
getChildren
public Components getChildren()
- Returns:
- the children
-
getChildren
public Components getChildren(String name)
-
getRootParent
@Nonnull protected SnippetComponent<?> getRootParent()
-
addAttributes
protected T addAttributes(@Nonnull org.jsoup.nodes.Attributes attrs)
- Parameters:
attrs- list of attributes- Returns:
- the fluent instance
-
addAttribute
protected T addAttribute(@Nonnull org.jsoup.nodes.Attribute attr)
- Parameters:
attr- attribute- Returns:
- the fluent instance
-
self
protected T self()
- Returns:
- the fluent instance
-
-