public class URIAttribute extends SingletonAttribute
In most cases, this URI will specify a URL. The difference between a URL and a URI is that a URI is unevaluated. That is, it is a string representation of a resource, without any assurance or indication of a file, stream, or other associated network resource. To access a URI, it is common to create a URL from its specification.
Unfortunately, URLs are not necessarily valid URIs. For example, a
URL that has a space in it is not a valid URI, the space must be
quoted (converted) to %20
.
NamedObj.ContainedObjectsIterator
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
URIAttribute(NamedObj container,
java.lang.String name)
Construct an attribute with the given name contained by the specified
container.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone(Workspace workspace)
Clone the attribute into the specified workspace.
|
static java.net.URI |
getModelURI(NamedObj container)
Return the URI from which the specified model was read,
or null if there is no such URI.
|
java.net.URI |
getURI()
Get the URI that has been set by setURI(),
or null if there is none.
|
java.net.URL |
getURL()
Get a URL representation of the URI that has been set by setURI(),
or null if there is none.
|
void |
setURI(java.net.URI uri)
Set the value of the URI, and call the attributeChanged() method
of the container.
|
void |
setURL(java.net.URL url)
Set the value of the URI by specifying a URL,
and call the attributeChanged() method of the container.
|
setContainer
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
public URIAttribute(NamedObj container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this attribute.IllegalActionException
- If the attribute is not of an
acceptable class for the container, or if the name contains a period.NameDuplicationException
- If the name coincides with
an attribute already in the container.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class Attribute
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public static java.net.URI getModelURI(NamedObj container)
container
- The container to start searching.public java.net.URI getURI()
setURI(URI)
public java.net.URL getURL() throws java.net.MalformedURLException
java.net.MalformedURLException
- If the URI cannot be converted to
a URL.java.lang.IllegalArgumentException
- If the URI is not absolute.setURL(URL)
public void setURI(java.net.URI uri) throws IllegalActionException
uri
- The new URI.IllegalActionException
- If the change is not acceptable
to the container.getURI()
public void setURL(java.net.URL url) throws IllegalActionException
url
- The URL.IllegalActionException
- If the change is not acceptable
to the container.getURL()