Package org.eclipse.epsilon.emc.html
Class HtmlModel
java.lang.Object
org.eclipse.epsilon.eol.models.Model
org.eclipse.epsilon.eol.models.CachedModel<org.jsoup.nodes.Element>
org.eclipse.epsilon.emc.html.HtmlModel
- All Implemented Interfaces:
AutoCloseable,IModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.epsilon.eol.models.IModel
IModel.AmbiguityCheckResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.jsoup.nodes.Documentprotected final Stringprotected Fileprotected org.jsoup.HttpStatusExceptionstatic final Stringstatic final Stringstatic final Stringprotected intprotected StringFields inherited from class org.eclipse.epsilon.eol.models.CachedModel
allContentsCache, kindCache, PROPERTY_CACHED, PROPERTY_CONCURRENT, typeCacheFields inherited from class org.eclipse.epsilon.eol.models.Model
aliases, ENV_PREFIX, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_READONLY, PROPERTY_STOREONDISPOSAL, propertyGetter, propertySetter, readOnLoad, storeOnDisposal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<org.jsoup.nodes.Element>protected org.jsoup.nodes.ElementcreateInstanceInModel(String type) protected booleandeleteElementInModel(Object instance) Returns true iff the given instance was deleted from the model.protected voidprotected Collection<org.jsoup.nodes.Element>getAllOfKindFromModel(String kind) protected Collection<org.jsoup.nodes.Element>getAllOfTypeFromModel(String type) protected Collection<String>getAllTypeNamesOf(Object instance) Returns the fully qualified names of every type to which the given object conforms.protected ObjectgetCacheKeyForType(String type) Returns an identity for the given type, which will be used byCachedModelas a key for the memoization of model elements by type.org.jsoup.nodes.DocumentgetElementById(String id) getElementId(Object instance) getEnumerationValue(String enumeration, String label) getFile()org.jsoup.HttpStatusExceptiongetTypeNameOf(Object instance) Returns a string representing the type of the instance object.getUri()booleanbooleanisInstantiable(String type) booleanisLoaded()Convenience method for determining when a model has been loaded.voidload(StringProperties properties, IRelativePathResolver resolver) protected voidbooleanUsed to test whether an object is contained in this model.voidsetElementId(Object instance, String newId) voidvoidbooleanstore()booleanMethods inherited from class org.eclipse.epsilon.eol.models.CachedModel
addToCache, allContents, clearCache, createInstance, deleteElement, dispose, getAllOfKind, getAllOfKindOrType, getAllOfType, initCaches, isCachingEnabled, isConcurrent, load, removeFromCache, setCachingEnabled, setConcurrent, wrapMethods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getPropertySetter, getTransactionSupport, getTypeOf, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, setName, setReadOnLoad, setStoredOnDisposalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.epsilon.eol.models.IModel
checkAmbiguity, close
-
Field Details
-
httpException
protected org.jsoup.HttpStatusException httpException -
document
protected org.jsoup.nodes.Document document -
ELEMENT_TYPE
- See Also:
-
PROPERTY_FILE
- See Also:
-
PROPERTY_URI
- See Also:
-
PROPERTY_TIMEOUT
- See Also:
-
uri
-
file
-
timeout
protected int timeout
-
-
Constructor Details
-
HtmlModel
public HtmlModel()
-
-
Method Details
-
load
public void load(StringProperties properties, IRelativePathResolver resolver) throws EolModelLoadingException - Specified by:
loadin interfaceIModel- Overrides:
loadin classCachedModel<org.jsoup.nodes.Element>- Throws:
EolModelLoadingException
-
getUri
-
setUri
-
setFile
-
getFile
-
isLoaded
public boolean isLoaded()Description copied from class:CachedModelConvenience method for determining when a model has been loaded.- Overrides:
isLoadedin classCachedModel<org.jsoup.nodes.Element>- Returns:
- Whether the cache has been populated.
-
getEnumerationValue
public Object getEnumerationValue(String enumeration, String label) throws EolEnumerationValueNotFoundException -
getTypeNameOf
Description copied from interface:IModelReturns a string representing the type of the instance object. The value returned by this function can be passed to createInstance to instantiate another object of the same type as instance.- Parameters:
instance- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
-
getElementById
-
getElementId
-
setElementId
-
owns
Description copied from interface:IModelUsed to test whether an object is contained in this model.- Parameters:
instance- the Java object to test.- Returns:
- true if and only if instance is contained by this model.
-
isInstantiable
-
hasType
-
store
-
store
public boolean store() -
allContentsFromModel
- Specified by:
allContentsFromModelin classCachedModel<org.jsoup.nodes.Element>
-
getAllOfTypeFromModel
protected Collection<org.jsoup.nodes.Element> getAllOfTypeFromModel(String type) throws EolModelElementTypeNotFoundException - Specified by:
getAllOfTypeFromModelin classCachedModel<org.jsoup.nodes.Element>- Throws:
EolModelElementTypeNotFoundException
-
getAllOfKindFromModel
protected Collection<org.jsoup.nodes.Element> getAllOfKindFromModel(String kind) throws EolModelElementTypeNotFoundException - Specified by:
getAllOfKindFromModelin classCachedModel<org.jsoup.nodes.Element>- Throws:
EolModelElementTypeNotFoundException
-
createInstanceInModel
protected org.jsoup.nodes.Element createInstanceInModel(String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException - Specified by:
createInstanceInModelin classCachedModel<org.jsoup.nodes.Element>- Throws:
EolModelElementTypeNotFoundExceptionEolNotInstantiableModelElementTypeException
-
loadModel
- Specified by:
loadModelin classCachedModel<org.jsoup.nodes.Element>- Throws:
EolModelLoadingException
-
disposeModel
protected void disposeModel()- Specified by:
disposeModelin classCachedModel<org.jsoup.nodes.Element>
-
deleteElementInModel
Description copied from class:CachedModelReturns true iff the given instance was deleted from the model.- Specified by:
deleteElementInModelin classCachedModel<org.jsoup.nodes.Element>- Throws:
EolRuntimeException
-
getCacheKeyForType
Description copied from class:CachedModelReturns an identity for the given type, which will be used byCachedModelas a key for the memoization of model elements by type.- Specified by:
getCacheKeyForTypein classCachedModel<org.jsoup.nodes.Element>- Throws:
EolModelElementTypeNotFoundException
-
getAllTypeNamesOf
Description copied from class:CachedModelReturns the fully qualified names of every type to which the given object conforms. The values are used by byCachedModelfor the memoization of model elements by their kind (CachedModel.getAllOfKind(String)).- Specified by:
getAllTypeNamesOfin classCachedModel<org.jsoup.nodes.Element>
-
getDocument
public org.jsoup.nodes.Document getDocument() -
getHttpException
public org.jsoup.HttpStatusException getHttpException()
-