public abstract class Node extends Object implements IVisitable
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
_attributes |
protected Map<String,Object> |
_extraProperties
Properties that are present in the source document,
but are not defined in the specification for this node,
so they can't be read directly into the data model fields.
|
protected int |
_modelId |
Document |
_ownerDocument |
Node |
_parent |
protected Map<String,ValidationProblem> |
_validationProblems |
Constructor and Description |
---|
Node() |
Modifier and Type | Method and Description |
---|---|
abstract void |
accept(IVisitor visitor)
Called to accept a visitor onto a visitable data model instance.
|
void |
addExtraProperty(String key,
Object value)
Adds an extra property to the data model.
|
ValidationProblem |
addValidationProblem(String errorCode,
NodePath nodePath,
String property,
String message,
ValidationProblemSeverity severity)
Adds a validation problem to the data model.
|
void |
clearAttributes()
Deletes all attributes in the node.
|
void |
clearValidationProblems()
Deletes all validation problems previously discovered for this node.
|
Object |
getAttribute(String attributeName)
Gets a single attribute by name.
|
Collection<String> |
getAttributeNames()
Gets a collection of all the attribute names.
|
Object |
getExtraProperty(String name) |
List<String> |
getExtraPropertyNames() |
List<String> |
getValidationProblemCodes()
Gets a list of all the validation problem codes for this node (and this node only).
|
List<ValidationProblem> |
getValidationProblems()
Gets a list of all the validation problems detected for this node.
|
List<ValidationProblem> |
getValidationProblemsFor(String propertyName)
Gets a list of all validation problems detected for this node, filtered by only those
problems that apply to the given property name.
|
boolean |
hasExtraProperties() |
boolean |
isExtensible()
Returns true if this node is extensible.
|
int |
modelId()
Gets the model's unique ID.
|
Document |
ownerDocument()
Gets the owner document.
|
Node |
parent()
Gets the parent.
|
Object |
removeExtraProperty(String name) |
void |
setAttribute(String attributeName,
Object attributeValue)
Sets a single named attribute value.
|
public Document _ownerDocument
public Node _parent
protected int _modelId
protected Map<String,Object> _extraProperties
protected Map<String,ValidationProblem> _validationProblems
public Document ownerDocument()
public boolean isExtensible()
public Node parent()
public int modelId()
public abstract void accept(IVisitor visitor)
IVisitable
accept
in interface IVisitable
IVisitable.accept(io.apicurio.datamodels.core.visitors.IVisitor)
public Object getAttribute(String attributeName)
attributeName
- public void setAttribute(String attributeName, Object attributeValue)
attributeName
- attributeValue
- public Collection<String> getAttributeNames()
public void clearAttributes()
public List<String> getValidationProblemCodes()
public List<ValidationProblem> getValidationProblems()
public List<ValidationProblem> getValidationProblemsFor(String propertyName)
propertyName
- public ValidationProblem addValidationProblem(String errorCode, NodePath nodePath, String property, String message, ValidationProblemSeverity severity)
errorCode
- nodePath
- property
- message
- severity
- public void clearValidationProblems()
public void addExtraProperty(String key, Object value)
key
- value
- public boolean hasExtraProperties()
Copyright © 2019 Red Hat. All rights reserved.