/******************************************************************************* | |
* Copyright (c) 2012, 2019 IBM Corporation and others. | |
* This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License 2.0 | |
* which accompanies this distribution, and is available at | |
* https://www.eclipse.org/legal/epl-2.0/ | |
* | |
* SPDX-License-Identifier: EPL-2.0 | |
* | |
* Contributors: | |
* IBM Corporation - initial API and implementation | |
*******************************************************************************/ | |
/** | |
*/ | |
package org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm; | |
import java.util.Collection; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.common.notify.NotificationChain; | |
import org.eclipse.emf.common.util.EList; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.util.EObjectContainmentEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
import org.eclipse.jpt.common.core.resource.xml.EBaseObject; | |
import org.eclipse.jpt.common.core.resource.xml.EBaseObjectImpl; | |
/** | |
* <!-- begin-user-doc --> | |
* A representation of the model object '<em><b>EXml Registry</b></em>'. | |
* <!-- end-user-doc --> | |
* | |
* <p> | |
* The following features are supported: | |
* <ul> | |
* <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlRegistry#getName <em>Name</em>}</li> | |
* <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlRegistry#getXmlElementDecls <em>Xml Element Decls</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.OxmPackage#getEXmlRegistry() | |
* @model kind="class" | |
* @extends EBaseObject | |
* @generated | |
*/ | |
public class EXmlRegistry extends EBaseObjectImpl implements EBaseObject | |
{ | |
/** | |
* The default value of the '{@link #getName() <em>Name</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getName() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String NAME_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getName() <em>Name</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getName() | |
* @generated | |
* @ordered | |
*/ | |
protected String name = NAME_EDEFAULT; | |
/** | |
* The cached value of the '{@link #getXmlElementDecls() <em>Xml Element Decls</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getXmlElementDecls() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<EXmlElementDecl> xmlElementDecls; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected EXmlRegistry() | |
{ | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() | |
{ | |
return OxmPackage.Literals.EXML_REGISTRY; | |
} | |
/** | |
* Returns the value of the '<em><b>Name</b></em>' attribute. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of the '<em>Name</em>' attribute isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @return the value of the '<em>Name</em>' attribute. | |
* @see #setName(String) | |
* @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.OxmPackage#getEXmlRegistry_Name() | |
* @model | |
* @generated | |
*/ | |
public String getName() | |
{ | |
return name; | |
} | |
/** | |
* Sets the value of the '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlRegistry#getName <em>Name</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @param value the new value of the '<em>Name</em>' attribute. | |
* @see #getName() | |
* @generated | |
*/ | |
public void setName(String newName) | |
{ | |
String oldName = name; | |
name = newName; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, OxmPackage.EXML_REGISTRY__NAME, oldName, name)); | |
} | |
/** | |
* Returns the value of the '<em><b>Xml Element Decls</b></em>' containment reference list. | |
* The list contents are of type {@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlElementDecl}. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of the '<em>Xml Element Decls</em>' containment reference list isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @return the value of the '<em>Xml Element Decls</em>' containment reference list. | |
* @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.OxmPackage#getEXmlRegistry_XmlElementDecls() | |
* @model containment="true" | |
* @generated | |
*/ | |
public EList<EXmlElementDecl> getXmlElementDecls() | |
{ | |
if (xmlElementDecls == null) | |
{ | |
xmlElementDecls = new EObjectContainmentEList<EXmlElementDecl>(EXmlElementDecl.class, this, OxmPackage.EXML_REGISTRY__XML_ELEMENT_DECLS); | |
} | |
return xmlElementDecls; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) | |
{ | |
switch (featureID) | |
{ | |
case OxmPackage.EXML_REGISTRY__XML_ELEMENT_DECLS: | |
return ((InternalEList<?>)getXmlElementDecls()).basicRemove(otherEnd, msgs); | |
} | |
return super.eInverseRemove(otherEnd, featureID, msgs); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) | |
{ | |
switch (featureID) | |
{ | |
case OxmPackage.EXML_REGISTRY__NAME: | |
return getName(); | |
case OxmPackage.EXML_REGISTRY__XML_ELEMENT_DECLS: | |
return getXmlElementDecls(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
@Override | |
public void eSet(int featureID, Object newValue) | |
{ | |
switch (featureID) | |
{ | |
case OxmPackage.EXML_REGISTRY__NAME: | |
setName((String)newValue); | |
return; | |
case OxmPackage.EXML_REGISTRY__XML_ELEMENT_DECLS: | |
getXmlElementDecls().clear(); | |
getXmlElementDecls().addAll((Collection<? extends EXmlElementDecl>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) | |
{ | |
switch (featureID) | |
{ | |
case OxmPackage.EXML_REGISTRY__NAME: | |
setName(NAME_EDEFAULT); | |
return; | |
case OxmPackage.EXML_REGISTRY__XML_ELEMENT_DECLS: | |
getXmlElementDecls().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) | |
{ | |
switch (featureID) | |
{ | |
case OxmPackage.EXML_REGISTRY__NAME: | |
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); | |
case OxmPackage.EXML_REGISTRY__XML_ELEMENT_DECLS: | |
return xmlElementDecls != null && !xmlElementDecls.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public String toString() | |
{ | |
if (eIsProxy()) return super.toString(); | |
StringBuffer result = new StringBuffer(super.toString()); | |
result.append(" (name: "); | |
result.append(name); | |
result.append(')'); | |
return result.toString(); | |
} | |
} // EXmlRegistry |