Modifier and Type | Field and Description |
---|---|
static KomodoObject[] |
EMPTY_ARRAY
An empty Komodo object array.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Repository.UnitOfWork transaction,
KomodoObjectVisitor visitor)
Visit this object with the given visitor.
|
KomodoObject |
addChild(Repository.UnitOfWork transaction,
String name,
String primaryType)
Adds a child with the supplied name and primary type.
|
void |
addDescriptor(Repository.UnitOfWork transaction,
String... descriptorNames)
Adds the specified descriptor name(s).
|
KomodoObject |
getChild(Repository.UnitOfWork transaction,
String name)
Obtains the first child with the specified name regardless of the type.
|
KomodoObject |
getChild(Repository.UnitOfWork transaction,
String name,
String typeName)
Obtains the first child with the specified name having the specified primary type or mixin.
|
KomodoObject[] |
getChildren(Repository.UnitOfWork transaction,
String... namePatterns)
Name patterns may be a full name or a partial name with one or more wildcard characters ("*").
|
KomodoObject[] |
getChildrenOfType(Repository.UnitOfWork transaction,
String type,
String... namePatterns)
Name patterns may be a full name or a partial name with one or more wildcard characters ("*").
|
KomodoType[] |
getChildTypes() |
Descriptor |
getDescriptor(Repository.UnitOfWork transaction,
String typeName) |
Descriptor[] |
getDescriptors(Repository.UnitOfWork transaction) |
int |
getIndex() |
KObjectFactory |
getObjectFactory() |
Descriptor |
getPrimaryType(Repository.UnitOfWork transaction) |
Property |
getProperty(Repository.UnitOfWork transaction,
String name) |
PropertyDescriptor |
getPropertyDescriptor(Repository.UnitOfWork transaction,
String propName) |
PropertyDescriptor[] |
getPropertyDescriptors(Repository.UnitOfWork transaction) |
KPropertyFactory |
getPropertyFactory() |
String[] |
getPropertyNames(Repository.UnitOfWork transaction)
Subclasses may choose to implement this so that it may not represent that actual, physical property names.
|
KomodoObject[] |
getRawChildren(Repository.UnitOfWork transaction,
String... namePatterns)
Subclasses may implement
#getChildren(UnitOfWork, String...) in such a way that it does not represent the actual
set of child nodes. |
Descriptor[] |
getRawDescriptors(Repository.UnitOfWork transaction) |
KomodoObject |
getRawParent(Repository.UnitOfWork transaction) |
Property |
getRawProperty(Repository.UnitOfWork transaction,
String name)
Obtains a property even if it has been filtered out by the subclasses.
|
PropertyDescriptor[] |
getRawPropertyDescriptors(Repository.UnitOfWork transaction) |
String[] |
getRawPropertyNames(Repository.UnitOfWork transaction)
Subclasses may implement
#getPropertyNames(UnitOfWork) in such a way that it does not represent the actual set of
properties. |
int |
getTypeId() |
KomodoType |
getTypeIdentifier(Repository.UnitOfWork transaction) |
boolean |
hasChild(Repository.UnitOfWork transaction,
String name)
Indicates if a child exists with the specified name, regardless of the type.
|
boolean |
hasChild(Repository.UnitOfWork transaction,
String name,
String typeName)
Indicates if a child exists with the specified name and the specified primary type or mixin.
|
boolean |
hasChildren(Repository.UnitOfWork transaction)
This method can be overridden by subclasses to filter out child nodes.
|
boolean |
hasDescriptor(Repository.UnitOfWork transaction,
String descriptorName) |
boolean |
hasProperties(Repository.UnitOfWork transaction) |
boolean |
hasProperty(Repository.UnitOfWork transaction,
String name) |
boolean |
hasRawChild(Repository.UnitOfWork transaction,
String name)
Indicates if a child, filtered or unfiltered, exists with the specified name, regardless of the type.
|
boolean |
hasRawChild(Repository.UnitOfWork transaction,
String name,
String typeName)
Indicates if a child, filtered or unfiltered, exists with the specified name and the specified primary type or mixin.
|
boolean |
hasRawChildren(Repository.UnitOfWork transaction) |
boolean |
hasRawProperty(Repository.UnitOfWork transaction,
String name) |
boolean |
isChildRestricted()
The implementing class is responsible for enforcing this restriction.
|
void |
print(Repository.UnitOfWork transaction)
Prints this object's subtree to standard out
|
void |
remove(Repository.UnitOfWork transaction)
Removes this node.
|
void |
removeChild(Repository.UnitOfWork transaction,
String... names)
To remove children with same name, the same name must be passed in more than once.
|
void |
removeDescriptor(Repository.UnitOfWork transaction,
String... descriptorNames) |
void |
rename(Repository.UnitOfWork transaction,
String newName) |
void |
setPrimaryType(Repository.UnitOfWork transaction,
String typeName) |
void |
setProperty(Repository.UnitOfWork transaction,
String propertyName,
Object... values)
Creates the property if it does not exist.
|
getAbsolutePath, getName, getParent, getRepository
static final KomodoObject[] EMPTY_ARRAY
KObjectFactory getObjectFactory()
KPropertyFactory getPropertyFactory()
KomodoObject addChild(Repository.UnitOfWork transaction, String name, String primaryType) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)name
- the name of the new child being added (cannot be empty)primaryType
- the primary type of the child or null
if type is nt:unstructured
null
)KException
- if an error occursvoid addDescriptor(Repository.UnitOfWork transaction, String... descriptorNames) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))descriptorNames
- the descriptor name(s) being added (cannot be empty)KException
- if an error occursKomodoObject getChild(Repository.UnitOfWork transaction, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of child being requested (cannot be empty)null
)KException
- if the child does not exist or an error occursKomodoObject getChild(Repository.UnitOfWork transaction, String name, String typeName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of child being requested (cannot be empty)typeName
- the primary type or mixin (cannot be empty)null
)KException
- if the child does not exist or an error occurs#getChild(UnitOfWork, String)
KomodoObject[] getChildren(Repository.UnitOfWork transaction, String... namePatterns) throws KException
transaction
- the transaction (cannot be null
or must have a state of Repository.UnitOfWork.State.NOT_STARTED
))namePatterns
- optional name patterns of the child(ren) being requested (can be null
or empty but cannot have
null
or empty elements)null
but can be empty)KException
- if the child does not exist or an error occursKomodoObject[] getChildrenOfType(Repository.UnitOfWork transaction, String type, String... namePatterns) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))type
- the primary type or mixin of the children being requested (cannot be empty)namePatterns
- optional name patterns (can be null
or empty but cannot have null
or empty elements)null
but can be empty)KException
- if an error occursKomodoType[] getChildTypes()
null
but can be empty if any type is allowed)isChildRestricted()
Descriptor getDescriptor(Repository.UnitOfWork transaction, String typeName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))typeName
- the name of the primary type or mixin whose descriptor is being requested (cannot be empty)null
)KException
- if descriptor is not found or an error occursDescriptor[] getDescriptors(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
but can be empty)KException
- if an error occursDescriptor getPrimaryType(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
)KException
- if an error occursProperty getProperty(Repository.UnitOfWork transaction, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of property being requested (cannot be empty)null
if the property doesn't existKException
- if an error occursPropertyDescriptor getPropertyDescriptor(Repository.UnitOfWork transaction, String propName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))propName
- the name of the property whose descriptor is being requested (cannot be empty)null
if not found)KException
- if an error occursPropertyDescriptor[] getPropertyDescriptors(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
but
can be empty)KException
- if an error occursString[] getPropertyNames(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
but can be empty)KException
- if an error occurs#getRawPropertyNames(UnitOfWork)
KomodoObject[] getRawChildren(Repository.UnitOfWork transaction, String... namePatterns) throws KException
#getChildren(UnitOfWork, String...)
in such a way that it does not represent the actual
set of child nodes. This method obtains the actual child nodes.transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))namePatterns
- optional name patterns of the child(ren) being requested (can be null
or empty but cannot have
null
or empty elements)null
but can be empty)KException
- if an error occursDescriptor[] getRawDescriptors(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
but can be empty)KException
- if an error occursProperty getRawProperty(Repository.UnitOfWork transaction, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of property, filtered or unfiltered, being requested (cannot be empty)null
if the property doesn't existKException
- if an error occursKomodoObject getRawParent(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
and must have a state of
Repository.UnitOfWork.State.NOT_STARTED
Komodo object
(can be null
if at the Komodo root)KException
- if an error occursPropertyDescriptor[] getRawPropertyDescriptors(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
but
can be empty)KException
- if an error occursString[] getRawPropertyNames(Repository.UnitOfWork transaction) throws KException
#getPropertyNames(UnitOfWork)
in such a way that it does not represent the actual set of
properties. This method obtains the actual, physical set of property names.transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
but can be empty)KException
- if an error occurs#getPropertyNames(UnitOfWork)
int getTypeId()
KomodoType getTypeIdentifier(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))null
)KException
- if error occursboolean hasChild(Repository.UnitOfWork transaction, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of the child whose existence is being checked (cannot be empty)true
if a child with the supplied name existsKException
- if an error occursboolean hasChild(Repository.UnitOfWork transaction, String name, String typeName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of the child whose existence is being checked (cannot be empty)typeName
- the primary type or mixin (cannot be empty)true
if a child with the supplied name and type existsKException
- if an error occursboolean hasChildren(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))true
if children existKException
- if an error occursboolean hasDescriptor(Repository.UnitOfWork transaction, String descriptorName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))descriptorName
- the name of the descriptor
being checked (cannot be empty)true
if this KomodoObject
has this descriptorKException
- if an error occursboolean hasProperties(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))true
if properties existKException
- if an error occursboolean hasProperty(Repository.UnitOfWork transaction, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name the property whose existence is being checked (cannot be empty)true
if a property with the supplied name existsKException
- if an error occursboolean hasRawChild(Repository.UnitOfWork transaction, String name) throws KException
transaction
- the transaction (cannot be null
or have a state other than Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of the child whose existence is being checked (cannot be empty)true
if a child with the supplied name existsKException
- if an error occursboolean hasRawChild(Repository.UnitOfWork transaction, String name, String typeName) throws KException
transaction
- the transaction (cannot be null
or have a state other than Repository.UnitOfWork.State.NOT_STARTED
))name
- the name of the child whose existence is being checked (cannot be empty)typeName
- the primary type or mixin (cannot be empty)true
if a child with the supplied name and type existsKException
- if an error occursboolean hasRawChildren(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state other than Repository.UnitOfWork.State.NOT_STARTED
))true
if children existKException
- if an error occursboolean hasRawProperty(Repository.UnitOfWork transaction, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))name
- the name the property, filtered or unfiltered, whose existence is being checked (cannot be empty)true
if a property with the supplied name existsKException
- if an error occursboolean isChildRestricted()
true
if children are not permittedvoid print(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))KException
- if an error occursvoid remove(Repository.UnitOfWork transaction) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))KException
- if an error occursvoid removeChild(Repository.UnitOfWork transaction, String... names) throws KException
#remove(UnitOfWork)
whenever the node being removed is available.transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))names
- the name(s) of the child(ren) being removed from this object (cannot be empty)KException
- if an error occurs#remove(UnitOfWork)
void removeDescriptor(Repository.UnitOfWork transaction, String... descriptorNames) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))descriptorNames
- the mixin(s) being removed (cannot be empty)KException
- if an error occursvoid rename(Repository.UnitOfWork transaction, String newName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))newName
- the new name (cannot be empty or contain any slashes)KException
- if an error occursvoid setPrimaryType(Repository.UnitOfWork transaction, String typeName) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))typeName
- the new primary type name or null
or empty if setting to nt:unstructured
KException
- if an error occursvoid setProperty(Repository.UnitOfWork transaction, String propertyName, Object... values) throws KException
null
value will remove the property. Passing multiple
values should only be used for creating and setting multi-valued properties.transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))propertyName
- the name of one of this model object's properties (cannot be null
or empty)values
- one or more new values (can be null
or empty)KException
- if an error occursIllegalArgumentException
- if trying to set a single-valued property with multiple values or trying to set values that are not compatible with
the property definitionvoid accept(Repository.UnitOfWork transaction, KomodoObjectVisitor visitor) throws Exception
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))visitor
- the visitorException
- if error occursint getIndex()
Copyright © 2013–2019. All rights reserved.