Java Code Examples for org.eclipse.xtext.XtextPackage#GRAMMAR__METAMODEL_DECLARATIONS

The following examples show how to use org.eclipse.xtext.XtextPackage#GRAMMAR__METAMODEL_DECLARATIONS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GrammarImpl.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
	switch (featureID) {
		case XtextPackage.GRAMMAR__NAME:
			return getName();
		case XtextPackage.GRAMMAR__USED_GRAMMARS:
			return getUsedGrammars();
		case XtextPackage.GRAMMAR__DEFINES_HIDDEN_TOKENS:
			return isDefinesHiddenTokens();
		case XtextPackage.GRAMMAR__HIDDEN_TOKENS:
			return getHiddenTokens();
		case XtextPackage.GRAMMAR__METAMODEL_DECLARATIONS:
			return getMetamodelDeclarations();
		case XtextPackage.GRAMMAR__RULES:
			return getRules();
	}
	return super.eGet(featureID, resolve, coreType);
}
 
Example 2
Source File: GrammarImpl.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eUnset(int featureID) {
	switch (featureID) {
		case XtextPackage.GRAMMAR__NAME:
			setName(NAME_EDEFAULT);
			return;
		case XtextPackage.GRAMMAR__USED_GRAMMARS:
			getUsedGrammars().clear();
			return;
		case XtextPackage.GRAMMAR__DEFINES_HIDDEN_TOKENS:
			setDefinesHiddenTokens(DEFINES_HIDDEN_TOKENS_EDEFAULT);
			return;
		case XtextPackage.GRAMMAR__HIDDEN_TOKENS:
			getHiddenTokens().clear();
			return;
		case XtextPackage.GRAMMAR__METAMODEL_DECLARATIONS:
			getMetamodelDeclarations().clear();
			return;
		case XtextPackage.GRAMMAR__RULES:
			getRules().clear();
			return;
	}
	super.eUnset(featureID);
}
 
Example 3
Source File: GrammarImpl.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public boolean eIsSet(int featureID) {
	switch (featureID) {
		case XtextPackage.GRAMMAR__NAME:
			return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
		case XtextPackage.GRAMMAR__USED_GRAMMARS:
			return usedGrammars != null && !usedGrammars.isEmpty();
		case XtextPackage.GRAMMAR__DEFINES_HIDDEN_TOKENS:
			return definesHiddenTokens != DEFINES_HIDDEN_TOKENS_EDEFAULT;
		case XtextPackage.GRAMMAR__HIDDEN_TOKENS:
			return hiddenTokens != null && !hiddenTokens.isEmpty();
		case XtextPackage.GRAMMAR__METAMODEL_DECLARATIONS:
			return metamodelDeclarations != null && !metamodelDeclarations.isEmpty();
		case XtextPackage.GRAMMAR__RULES:
			return rules != null && !rules.isEmpty();
	}
	return super.eIsSet(featureID);
}
 
Example 4
Source File: GrammarImpl.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public EList<AbstractMetamodelDeclaration> getMetamodelDeclarations() {
	if (metamodelDeclarations == null) {
		metamodelDeclarations = new EObjectContainmentEList<AbstractMetamodelDeclaration>(AbstractMetamodelDeclaration.class, this, XtextPackage.GRAMMAR__METAMODEL_DECLARATIONS);
	}
	return metamodelDeclarations;
}
 
Example 5
Source File: GrammarImpl.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
	switch (featureID) {
		case XtextPackage.GRAMMAR__METAMODEL_DECLARATIONS:
			return ((InternalEList<?>)getMetamodelDeclarations()).basicRemove(otherEnd, msgs);
		case XtextPackage.GRAMMAR__RULES:
			return ((InternalEList<?>)getRules()).basicRemove(otherEnd, msgs);
	}
	return super.eInverseRemove(otherEnd, featureID, msgs);
}
 
Example 6
Source File: GrammarImpl.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
	switch (featureID) {
		case XtextPackage.GRAMMAR__NAME:
			setName((String)newValue);
			return;
		case XtextPackage.GRAMMAR__USED_GRAMMARS:
			getUsedGrammars().clear();
			getUsedGrammars().addAll((Collection<? extends Grammar>)newValue);
			return;
		case XtextPackage.GRAMMAR__DEFINES_HIDDEN_TOKENS:
			setDefinesHiddenTokens((Boolean)newValue);
			return;
		case XtextPackage.GRAMMAR__HIDDEN_TOKENS:
			getHiddenTokens().clear();
			getHiddenTokens().addAll((Collection<? extends AbstractRule>)newValue);
			return;
		case XtextPackage.GRAMMAR__METAMODEL_DECLARATIONS:
			getMetamodelDeclarations().clear();
			getMetamodelDeclarations().addAll((Collection<? extends AbstractMetamodelDeclaration>)newValue);
			return;
		case XtextPackage.GRAMMAR__RULES:
			getRules().clear();
			getRules().addAll((Collection<? extends AbstractRule>)newValue);
			return;
	}
	super.eSet(featureID, newValue);
}