|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.io.graphml.input.AbstractInputHandler
public abstract class AbstractInputHandler
An abstract convenience implementation of the InputHandler interface.
| Constructor Summary | |
|---|---|
protected |
AbstractInputHandler()
Initializes a new instance of the AbstractInputHandler class. |
protected |
AbstractInputHandler(ParsePrecedence precedence)
Initializes a new instance of the AbstractInputHandler class. |
| Method Summary | |
|---|---|
void |
applyDefault(GraphMLParseContext context)
This method is invoked when no data tag is defined, and the default value should be applied. |
Object |
getDefaultValue()
Gets the default value that will be applied to the keys where the data attribute is missing. |
ParsePrecedence |
getPrecedence()
Gets the parse precedence that is associated with this handler. |
Set |
getValidScopes()
Allows to restrict the scopes where the handler is used, if the handler is registered to KeyScope.ALL. |
void |
initializeFromKeyDefinition(GraphMLParseContext context,
Element definition)
Initializes this instance from the GraphML key definition. |
boolean |
isDefaultExists()
Gets value indicating whether the default value exists in the key definition. |
boolean |
isParseDefaultValue()
Gets a value indicating whether the default value in the key definition should be parsed. |
void |
parseData(GraphMLParseContext context,
Node node)
This method is invoked each time a data element with matching key is processed. |
protected abstract Object |
parseDataCore(GraphMLParseContext context,
Node node)
Abstract method callback that actually parses the data. |
void |
setDefaultExists(boolean value)
Sets a value indicating whether the default value exists in the key definition. |
void |
setDefaultValue(Object value)
Sets the default value that will be applied to the keys where the data attribute is missing. |
void |
setParseDefaultValue(boolean value)
Sets a value indicating whether the default value in the key definition should be parsed. |
void |
setPrecedence(ParsePrecedence value)
Sets the parse precedence that is associated with this handler. |
void |
setValidScopes(Set value)
Allows to restrict the scopes where the handler is used, if the handler is registered to KeyScope.ALL. |
protected abstract void |
setValue(GraphMLParseContext context,
Object key,
Object data)
Abstract method callback that actually stores the value with the keys. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractInputHandler()
AbstractInputHandler class.
The getPrecedence() has an initial value
of ParsePrecedence.DEFAULT.
protected AbstractInputHandler(ParsePrecedence precedence)
AbstractInputHandler class.
The getPrecedence() gets the initial value
assigned to precedence
precedence - The precedence to assign to the getPrecedence() property.| Method Detail |
|---|
public boolean isParseDefaultValue()
true if the default value should be parsed; otherwise, false. The default is true.setParseDefaultValue(boolean),
getDefaultValue()public void setParseDefaultValue(boolean value)
value - true if the default value should be parsed; otherwise, false. The default is true.getDefaultValue(),
setDefaultExists(boolean)public Object getDefaultValue()
setDefaultValue(Object)public void setDefaultValue(Object value)
value - The default value.getDefaultValue()public boolean isDefaultExists()
If this property is to true, the
applyDefault(GraphMLParseContext) method will call the
setValue(GraphMLParseContext, Object, Object) method
true if the default value exists; otherwise, false.setDefaultExists(boolean),
isParseDefaultValue(),
getDefaultValue()public void setDefaultExists(boolean value)
If this property is set to true, the
applyDefault(GraphMLParseContext) method will call the
setValue(GraphMLParseContext, Object, Object) method
value - true if the default value exists; otherwise, false.isDefaultExists(),
isParseDefaultValue(),
getDefaultValue()public ParsePrecedence getPrecedence()
getPrecedence in interface InputHandlersetPrecedence(ParsePrecedence)public void setPrecedence(ParsePrecedence value)
value - The parse precedence.getPrecedence()
public void parseData(GraphMLParseContext context,
Node node)
throws GraphMLParseException
parseData in interface InputHandlerGraphMLParseExceptioncontext - the current parse context.node - the DOM node representing the data element.parseDataCore(GraphMLParseContext,org.w3c.dom.Node)public Set getValidScopes()
KeyScope.ALL.
By default the collection contains the KeyScope.ALL.
KeyScopes for this handler.setValidScopes(java.util.Set)public void setValidScopes(Set value)
KeyScope.ALL.
By default the collection contains the KeyScope.ALL.
value - A set of valid KeyScopes for this handler.getValidScopes()
public void initializeFromKeyDefinition(GraphMLParseContext context,
Element definition)
throws GraphMLParseException
This implementation looks for the GraphML default element and delegates to
parseDataCore(GraphMLParseContext, org.w3c.dom.Node) if a default
is found to store the getDefaultValue() and set the
isDefaultExists() property.
GraphMLParseExceptioncontext - The context.definition - The definition.
protected abstract Object parseDataCore(GraphMLParseContext context,
Node node)
throws GraphMLParseException
GraphMLParseExceptioncontext - The context.node - The node that contains the data. This is either the GraphML data element or the
default element.
protected abstract void setValue(GraphMLParseContext context,
Object key,
Object data)
throws GraphMLParseException
GraphMLParseExceptioncontext - The context.key - The key.data - The data.
public void applyDefault(GraphMLParseContext context)
throws GraphMLParseException
This implementation delegates to
setValue(GraphMLParseContext, Object, Object).
if isDefaultExists()
applyDefault in interface InputHandlerGraphMLParseExceptioncontext - the current parse context.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||