Package net.arcadiusmc.dom
Interface JavaObjectElement
- All Superinterfaces:
DomQueryable,Element,EventTarget,Node
The Java Object element in the header allows for java classes to be
triggered from the DOM by specifying their class name.
Activation
When the Attributes.CLASS_NAME attribute is set, a lookup is
made via Class.forName(String, boolean, ClassLoader) to find
the class.
If found, then a public static void onDomInitialize(Document)
method in the class is called. If the method cannot be found, then a
public constructor with a single Document parameter will be
called. If that doesn't exist, activation fails.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the linked class.Class<?> Get the class named bygetClassName().voidsetClassName(String className) Set the name of the linked class.booleanGet whether thegetJavaClass()'s entry point was called.Methods inherited from interface net.arcadiusmc.dom.DomQueryable
getElementsByClassName, getElementsByTagName, querySelector, querySelectorAllMethods inherited from interface net.arcadiusmc.dom.Element
appendChild, appendElement, appendText, canHaveChildren, clearChildren, firstChild, forEachDescendant, getAttribute, getAttributeEntries, getAttributeNames, getChild, getChildCount, getChildren, getClassList, getCurrentStyle, getId, getInlineStyle, getTagName, getTextContent, getTitleNode, getTooltip, hasChild, hasChildren, indexOf, insertAfter, insertBefore, isDescendant, lastChild, matches, prependChild, removeChild, removeChild, replaceChild, replaceChild, setAttribute, setId, setTextContent, setTitleNodeMethods inherited from interface net.arcadiusmc.dom.event.EventTarget
addEventListener, dispatchEvent, removeEventListenerMethods inherited from interface net.arcadiusmc.dom.Node
enterVisitor, exitVisitor, getDepth, getOwningDocument, getParent, getSiblingIndex, hasFlag, nextSibling, previousSibling
-
Field Details
-
INIT_METHOD_NAME
- See Also:
-
-
Method Details
-
getClassName
String getClassName()Get the name of the linked class.If the class name is set, and the class it was linked to was found, then it can be accessed with
getJavaClass().Shortcut for accessing the
Attributes.CLASS_NAMEattribute.- Specified by:
getClassNamein interfaceElement- Returns:
- Java Class name
-
getJavaClass
Class<?> getJavaClass()Get the class named bygetClassName().- Returns:
- Java class
-
wasEntrypointCalled
boolean wasEntrypointCalled()Get whether thegetJavaClass()'s entry point was called. If this method returnsfalse, then it means the entrypoint couldn't be found or threw an error when called.- Returns:
true, if the class entry point was called successfully,falseotherwise.
-
setClassName
Set the name of the linked class.Shortcut for changing the
Attributes.CLASS_NAMEattribute.- Specified by:
setClassNamein interfaceElement- Parameters:
className- New class name
-