本文整理汇总了Java中net.ssehub.easy.instantiation.core.model.common.VilException.ID_INVALID属性的典型用法代码示例。如果您正苦于以下问题:Java VilException.ID_INVALID属性的具体用法?Java VilException.ID_INVALID怎么用?Java VilException.ID_INVALID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.ssehub.easy.instantiation.core.model.common.VilException
的用法示例。
在下文中一共展示了VilException.ID_INVALID属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
/**
* Creates a new XmlComment as child of given parent.
* @param parent The parent of the new XmlComment.
* @param contents optional initial contents, ignored if empty
* @return The created XmlElement.
* @throws VilException if element could not be created.
*/
public static XmlComment create(XmlElement parent, @ParameterMeta(name = "contents") String contents)
throws VilException {
XmlComment newElement = null;
if (null == parent) {
throw new VilException("Can not append child from NULL element!", VilException.ID_IS_NULL);
}
try {
Comment newNode = parent.getNode().getOwnerDocument().createComment(contents);
parent.getNode().appendChild(newNode); // notifies change
newElement = new XmlComment(parent, newNode);
parent.addChild(newElement); // notifies change
} catch (DOMException exc) {
throw new VilException("Invalid character, name or ID!", VilException.ID_INVALID);
}
if (null != contents && contents.length() > 0) {
newElement.setCdata(contents);
}
return newElement;
}
示例2: create
/**
* Creates a new XmlElement as child of given parent, with given name.
* @param parent The parent of the new XmlElement.
* @param name The name of the new XmlElement.
* @param contents optional initial contents, ignored if empty
* @return The created XmlElement.
* @throws VilException if element could not be created.
*/
public static XmlElement create(XmlElement parent, String name,
@ParameterMeta(name = "contents") String contents) throws VilException {
XmlElement newElement = null;
if (null == parent) {
throw new VilException("Can not append child from NULL element!", VilException.ID_IS_NULL);
}
try {
Element newNode = parent.getNode().getOwnerDocument().createElement(name);
parent.getNode().appendChild(newNode); // notifies change
newElement = new XmlElement(parent, name, null, newNode);
parent.addChild(newElement); // notifies change
parent.synchronizeAttributeSequence();
} catch (DOMException exc) {
throw new VilException("Invalid character, name or ID!", VilException.ID_INVALID);
}
if (null != contents && contents.length() > 0) {
newElement.setCdata(contents);
}
return newElement;
}
示例3: appendChild
/**
* Appends a new child. Default position is after last child of the parent.
*
* @param child The new child XmlElement.
* @param childNode The new child Node.
* @return The created XmlElement.
* @throws VilException If child could not be appended.
*/
XmlElement appendChild(XmlElement child, Node childNode) throws VilException {
if (null == child || null == childNode) {
throw new VilException("NULL can not be added as a child of an XmlElement!",
VilException.ID_IS_NULL);
}
this.insertElement(child, this.nodes[this.nodes.length - 1]);
try {
getNode().appendChild(childNode);
} catch (DOMException exc) {
throw new VilException("Unable to append a child from a " + getNode().getNodeName() + " Node!",
VilException.ID_INVALID);
}
notifyChange();
return child;
}
示例4: handleInPlaceVarDecl
/**
* Handles/parses an in-place variable declaration start.
*
* @param expressionString the expression string
* @param curStart the start position of the current concept
* @param pos the end position of parsing
* @return the remaining expression string
* @throws VilException in case of parsing problems
*/
private String handleInPlaceVarDecl(String expressionString, int curStart, int pos) {
String result;
try {
result = removePrefix(expressionString, "VAR", true);
int pos1 = consumeJavaIdentifierPart(result);
String varName = result.substring(0, pos1);
result = consumeWhitespaces(result.substring(pos1));
if (result.startsWith("=")) {
result = consume(result, '=');
}
result = consumeWhitespaces(result);
Expression init = parseExpression(result);
if (null == init) {
throw new VilException("Initialization expression missing / not resolved.", VilException.ID_INVALID);
}
I var = factory.createVariable(varName, init, false);
push(new InPlaceVarDeclCommand<I>(var), curStart, pos);
} catch (VilException e) {
warnParsingIgnoring(expressionString, e);
result = expressionString; // just keep it
}
return result;
}
示例5: createProfilePipeline
/**
* Profiles the given algorithm. Create a specific pipeline with data source, specific family holding
* only the test algorithm. Stores data and control file into <code>source</code>.
*
* @param config the configuration to be used as basis for creating a profiling pipeline
* @param pipelineName the name of the pipeline to be created (must be a valid Java identifier)
* @param familyName the name of the family to test
* @param algorithmName the name of the algorithm within <code>family</code> to test
* @param source the source project descriptor, also to be used as target folder for instantiation (the folder may
* be empty)
* @return pipeline information
* @throws VilException in case of model query problems, model management problems, CST errors, unmatching IVML
* values or VIL execution errors
*/
@QMInternal
public static ProfileData createProfilePipeline(net.ssehub.easy.varModel.confModel.Configuration config,
String pipelineName, String familyName, String algorithmName, IProjectDescriptor source) throws VilException {
ProfileData result = null;
if (null == config.getProject()) {
throw new VilException("no project available - syntax/parsing error?", VilException.ID_INVALID);
}
try {
Project qm = createNewRoot(config, pipelineName, familyName, algorithmName);
Configuration cfg = new Configuration(qm);
TracerFactory.setInstance(ConsoleTracerFactory.INSTANCE); // clear thread specific instance
StandaloneProjectDescriptor target = new StandaloneProjectDescriptor(source, source.getBase());
Executor executor = new Executor(source.getMainVilScript())
.addSource(source).addTarget(target)
.addConfiguration(cfg)
.addCustomArgument("pipelineName", pipelineName)
.addStartRuleName("pipeline");
executor.execute();
TracerFactory.setInstance(null); // clear thread specific instance
File base = source.getBase();
Compound familyType = findCompound(qm, TYPE_FAMILY);
IDecisionVariable testFamily = findNamedVariable(config, familyType, familyName);
IDecisionVariable testAlgorithm = Configuration.dereference(findAlgorithm(testFamily, algorithmName, true));
String algArtifact = VariableHelper.getString(testAlgorithm, SLOT_ALGORITHM_ARTIFACT);
extractProfilingArtifact(algArtifact, algorithmName, base);
File pipFile = new File(base, "pipelines/eu/qualimaster/" + pipelineName + "/target/" + pipelineName
+ "-" + PIP_VERSION + "-jar-with-dependencies.jar");
File dataFile = getDataFile(base);
File controlFile = getControlFile(base);
result = new ProfileData(pipelineName, pipFile, dataFile, controlFile);
} catch (ModelQueryException | ModelManagementException | ValueDoesNotMatchTypeException
| CSTSemanticException e) {
throw new VilException(e.getMessage(), VilException.ID_RUNTIME);
}
return result;
}
示例6: MultiAndExpression
/**
* Creates a multi-and expression.
*
* @param expressions the individual expressions
* @throws VilException if <code>expressions</code> or an expression within is <b>null</b>
*/
public MultiAndExpression(AbstractCallExpression... expressions) throws VilException {
if (null == expressions) {
throw new VilException("No expression given", VilException.ID_INVALID);
}
for (int e = 0; e < expressions.length; e++) {
if (null == expressions[e]) {
throw new VilException("Expression missing", VilException.ID_INVALID);
}
}
this.expressions = expressions;
}
示例7: initializeConfiguration
/**
* Initializes a QM model with runtime instances. [preliminary, separate concerns]
*
* @param config the configuration
* @param newVariablePrefix the prefix for the new variables
* @param initActual whether actual instance shall be initialized by default
* @throws VilException in case that initialization fails
*/
@QMInternal
public static void initializeConfiguration(net.ssehub.easy.varModel.confModel.Configuration config,
String newVariablePrefix, boolean initActual) throws VilException {
Project project = config.getProject();
if (null == project) {
throw new VilException("no project available - syntax/parsing error?", VilException.ID_INVALID);
}
try {
// did not want to introduce an IVML copy operation by now
Enum bindingTime = (Enum) ModelQuery.findType(project, TYPE_BINDING_TIME, Enum.class);
// take any one - just used for type and name
Attribute annotation = (Attribute) ModelQuery.findElementByName(project, ANNOTATION_BINDING_TIME,
Attribute.class);
IFreezeProvider freezeProvider = new EnumAttributeFreezeProvider("b", annotation,
OclKeyWords.GREATER_EQUALS, bindingTime.getLiteral(1));
Compound sourceType = findCompound(project, TYPE_SOURCE);
CopySpec specSource = new CopySpec(sourceType, SLOT_SOURCE_SOURCE, freezeProvider,
select(initActual, SLOT_SOURCE_AVAILABLE, SLOT_SOURCE_ACTUAL));
Compound familyElementType = findCompound(project, TYPE_FAMILYELEMENT);
CopySpec specFamily = new CopySpec(familyElementType, SLOT_FAMILYELEMENT_FAMILY
+ IvmlKeyWords.COMPOUND_ACCESS + SLOT_FAMILY_MEMBERS, freezeProvider,
select(initActual, SLOT_FAMILYELEMENT_AVAILABLE, SLOT_FAMILYELEMENT_ACTUAL));
Compound sinkType = findCompound(project, TYPE_SINK);
CopySpec specSink = new CopySpec(sinkType, SLOT_SINK_SINK, freezeProvider,
select(initActual, SLOT_SINK_AVAILABLE, SLOT_SINK_ACTUAL));
Compound replaySinkType = findCompound(project, TYPE_REPLAYSINK);
CopySpec specReplaySink = new CopySpec(replaySinkType, SLOT_REPLAYSINK_SINK, freezeProvider,
select(initActual, SLOT_REPLAYSINK_AVAILABLE, SLOT_REPLAYSINK_ACTUAL));
VariableValueCopier copier = new VariableValueCopier(newVariablePrefix, specSource, specFamily, specSink,
specReplaySink);
copier.process(config);
} catch (ConfigurationException e1) {
throw new VilException(e1, VilException.ID_RUNTIME);
} catch (ValueDoesNotMatchTypeException e2) {
throw new VilException(e2, VilException.ID_RUNTIME);
} catch (ModelQueryException e3) {
throw new VilException(e3, VilException.ID_RUNTIME);
} catch (CSTSemanticException e4) {
throw new VilException(e4, VilException.ID_RUNTIME);
}
}
示例8: checkValidity
/**
* Checks the validity of this object.
*
* @throws VilException in case that this object is invalid
*/
protected void checkValidity() throws VilException {
if (null == this.node) {
throw new VilException("element already deleted", VilException.ID_INVALID);
}
}
示例9: checkValidity
/**
* Checks the validity of this object.
*
* @throws VilException in case that this object is invalid
*/
private void checkValidity() throws VilException {
if (null == parent) {
throw new VilException("attribute already deleted", VilException.ID_INVALID);
}
}