-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
208 additions
and
1 deletion.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
src/main/java/mx/infotec/dads/essence/exception/EssenceCoreException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* | ||
* The MIT License (MIT) | ||
* Copyright (c) 2016 Daniel Cortes Pichardo | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
package mx.infotec.dads.essence.exception; | ||
|
||
/** | ||
* Runtime Exception for the Essence Meta-Model | ||
* | ||
* @author Daniel Cortes Pichardo | ||
* | ||
*/ | ||
public class EssenceCoreException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* Constructs a new LanguageElementException runtime exception with | ||
* {@code null} as its detail message. The cause is not initialized, and may | ||
* subsequently be initialized by a call to {@link #initCause}. | ||
*/ | ||
public EssenceCoreException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs a new LanguageElementException runtime exception with the | ||
* specified detail message. The cause is not initialized, and may | ||
* subsequently be initialized by a call to {@link #initCause}. | ||
* | ||
* @param message | ||
* the detail message. The detail message is saved for later | ||
* retrieval by the {@link #getMessage()} method. | ||
*/ | ||
public EssenceCoreException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs a new LanguageElementException runtime exception with the | ||
* specified detail message and cause. | ||
* | ||
* @param message | ||
* the detail message (which is saved for later retrieval by the | ||
* {@link #getMessage()} method). | ||
* @param cause | ||
* the cause (which is saved for later retrieval by the | ||
* {@link #getCause()} method). (A <tt>null</tt> value is | ||
* permitted, and indicates that the cause is nonexistent or | ||
* unknown.) | ||
* | ||
*/ | ||
public EssenceCoreException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs a new LanguageElementException runtime exception with the | ||
* specified cause and a detail message of | ||
* <tt>(cause==null ? null : cause.toString())</tt> (which typically | ||
* contains the class and detail message of <tt>cause</tt>). This | ||
* constructor is useful for runtime exceptions that are little more than | ||
* wrappers for other throwables. | ||
* | ||
* @param cause | ||
* the cause (which is saved for later retrieval by the | ||
* {@link #getCause()} method). (A <tt>null</tt> value is | ||
* permitted, and indicates that the cause is nonexistent or | ||
* unknown.) | ||
* | ||
*/ | ||
public EssenceCoreException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/mx/infotec/dads/essence/repository/KernelEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* | ||
* The MIT License (MIT) | ||
* Copyright (c) 2016 Daniel Cortes Pichardo | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package mx.infotec.dads.essence.repository; | ||
|
||
/** | ||
* Kernel Enum, for the Essence Core | ||
* | ||
* @author Daniel Cortes Pichardo | ||
* @since essence 1.1 | ||
* @version 1.1 | ||
*/ | ||
public enum KernelEnum { | ||
KERNEL, METHOD, PRACTICE, ALPHA, COMPETENCY, COMPETENCYLEVEL, ACTION, ACTIVITY, ACTIVITYASSOCIATION, ACTIVITYSPACE, COMPLETIONCRITERION, ENTRYCRITERION, ALPHAASSOCIATION, ALPHACONTAINMENT, LEVELOFDETAIL, STATE, WORKPRODUCT, WORKPRODUCTMANIFEST, CHECKPOINT, ENDEAVORPROPERTY, EXTENSIONELEMENT, LIBRARY, MERGERESOLUTION, PATTERN, PATTERNASSOCIATION, PRACTICEASSET, RESOURCE, TAG, TYPEDPATTERN, TYPEDRESOURCE, TYPEDTAG, USERDEFINEDTYPE, FEATURESELECTION, VIEWSELECTION | ||
} |
76 changes: 76 additions & 0 deletions
76
src/main/java/mx/infotec/dads/essence/util/EssenceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* | ||
* The MIT License (MIT) | ||
* Copyright (c) 2016 Daniel Cortes Pichardo | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package mx.infotec.dads.essence.util; | ||
|
||
import java.util.ArrayList; | ||
|
||
import mx.infotec.dads.essence.model.foundation.SEPractice; | ||
|
||
/** | ||
* | ||
* @author Daniel Cortes Pichardo | ||
* @since essence 1.1 | ||
* @version 1.1 | ||
*/ | ||
public class EssenceFactory { | ||
|
||
private EssenceFactory() { | ||
|
||
} | ||
|
||
/** | ||
* Create a DefaultPractice | ||
* | ||
* @return SEPractice | ||
*/ | ||
public static SEPractice createDefaultPractice() { | ||
SEPractice practice = new SEPractice(); | ||
// Practice | ||
practice.setConsistencyRules(""); | ||
practice.setEntry(new ArrayList<>()); | ||
practice.setMeasures(new ArrayList<>()); | ||
practice.setObjective(""); | ||
practice.setResult(new ArrayList<>()); | ||
// ElementGroup | ||
practice.setBriefDescription(""); | ||
practice.setDescription(""); | ||
practice.setIcon(null); | ||
practice.setMergeResolution(null); | ||
practice.setName(""); | ||
practice.setOwnedElements(new ArrayList<>()); | ||
practice.setReferredElements(new ArrayList<>()); | ||
// Inheritance | ||
practice.setExtension(new ArrayList<>()); | ||
practice.setFeatureSelection(new ArrayList<>()); | ||
practice.setOwner(null); | ||
practice.setPatternAssociation(new ArrayList<>()); | ||
practice.setProperties(new ArrayList<>()); | ||
practice.setReferrer(new ArrayList<>()); | ||
practice.setResource(new ArrayList<>()); | ||
practice.setSuppressable(false); | ||
practice.setTag(new ArrayList<>()); | ||
practice.setViewSelection(new ArrayList<>()); | ||
return practice; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters