protected InstanceFeatureDescriptionWithImplicitReceiver( QualifiedName qualifiedName, JvmFeature feature, XExpression receiver, LightweightTypeReference receiverType, Map<JvmTypeParameter, LightweightMergedBoundTypeArgument> typeParameterMapping, int receiverConformanceFlags, int bucketId, boolean visible, boolean validStaticState) { super(qualifiedName, feature, EcoreUtil.copy(receiver), receiverType, typeParameterMapping, receiverConformanceFlags, bucketId, visible); this.validStaticState = validStaticState; }
public static Expression cloneExpression(Expression exp) { return (Expression)EcoreUtil.copy(exp); }
/** * A generified facade to {@link EcoreUtil#copy(EObject)}. * Note that since EMF 2.6 {@link EcoreUtil#copy(EObject)} is already generic. * @deprecated use {@link EcoreUtil#copy(EObject)} instead. */ @Deprecated public static <T extends EObject> T clone(T eObject) { return EcoreUtil.copy(eObject); }
public void apply(final FieldPartSpecification fps) { EList<FieldPartSpecification> _parts = cf.getParts(); EObject _copy = EcoreUtil.copy(fps); _parts.add(((FieldPartSpecification) _copy)); } };
public static void setFieldPartSpecificationFromStyle(StyleSpecificationProperty sp, CustomizeableField cf) { if (cf.getParts().size() == 0) { StylePropertyFieldPart fp = (StylePropertyFieldPart)sp; for (FieldPartSpecification fps : fp.getParts()) { cf.getParts().add((FieldPartSpecification)EcoreUtil.copy(fps)); } } }
protected void _combineStyleSpecification(final StylePropertyTable it, final StylePropertyTable spec) { BoolLiteral _gridVisible = spec.getGridVisible(); EObject _copy = _gridVisible==null?(EObject)null:EcoreUtil.copy(_gridVisible); it.setGridVisible(((BoolLiteral) _copy)); BoolLiteral _oneWay = spec.getOneWay(); EObject _copy_1 = _oneWay==null?(EObject)null:EcoreUtil.copy(_oneWay); it.setOneWay(((BoolLiteral) _copy_1)); }
protected void processPull ( final AlarmsEventsModule module, final Global global ) { if ( global.getLocalPull () == null ) { return; } module.getPullEvents ().add ( EcoreUtil.copy ( global.getLocalPull () ) ); }
private void processProfile ( final File output ) throws IOException { final Profile profile = makeProfile ( this.app ); final File profileFile = new File ( output, this.app.getName () + ".profile.xml" ); //$NON-NLS-1$ final ResourceSet rs = new ResourceSetImpl (); final Resource r = rs.createResource ( URI.createFileURI ( profileFile.toString () ) ); r.getContents ().add ( EcoreUtil.copy ( profile ) ); final Map<Object, Object> options = new HashMap<> (); options.put ( XMLResource.OPTION_ENCODING, "UTF-8" ); //$NON-NLS-1$ r.save ( options ); }
private void processProfile ( final File output ) throws IOException { final Profile profile = makeProfile ( this.app ); final File profileFile = new File ( output, this.app.getName () + ".profile.xml" ); //$NON-NLS-1$ final ResourceSet rs = new ResourceSetImpl (); final Resource r = rs.createResource ( URI.createFileURI ( profileFile.toString () ) ); r.getContents ().add ( EcoreUtil.copy ( profile ) ); final Map<Object, Object> options = new HashMap<> (); options.put ( XMLResource.OPTION_ENCODING, "UTF-8" ); //$NON-NLS-1$ r.save ( options ); }
@Override public void customize ( final Item item ) { final LevelMonitor levelMonitor = EcoreUtil.copy ( this.template ); levelMonitor.setName ( this.name ); levelMonitor.setPreset ( this.value ); registerFeature ( item, levelMonitor ); }; }
private void generateFor ( final GenerationContext context, final MasterServer master ) { final org.eclipse.scada.configuration.world.osgi.MasterServer mapped = this.context.getEquinoxApplication ( master ); final DataMapper result = EcoreUtil.copy ( this.service.getDataMapper () ); mapped.getDataMapper ().add ( result ); context.addMapping ( this.service, result ); }
@Override public void customize ( final Item item ) { final LevelMonitor levelMonitor = EcoreUtil.copy ( this.template ); levelMonitor.setName ( this.name ); levelMonitor.setPreset ( this.value ); registerFeature ( item, levelMonitor ); }; }
public XtextResource createResource() { ResourceSet resourceSet = resourceSetProvider.get(null); Resource grammarResource = resourceSet.createResource( URI.createURI(SYNTHETIC_SCHEME + ":/" + grammarAccess.getGrammar().getName() + ".xtext")); grammarResource.getContents().add(EcoreUtil.copy(grammarAccess.getGrammar())); XtextResource result = (XtextResource) resourceSet.createResource( URI.createURI(SYNTHETIC_SCHEME + ":/" + grammarAccess.getGrammar().getName() + ".___singlecodetemplate")); resourceSet.getResources().add(result); return result; } }
private static void setRightPropertyFromStyle(EList<LayoutDataProperty> lpl, StylePropertyRight spr) { for (LayoutDataProperty ldp : lpl) { if (ldp instanceof AttachmentProperty && ((AttachmentProperty)ldp).getOwnPosition().getValue() == AttachmentOwnPosition.RIGHT_VALUE) { return; } } AttachmentProperty ap = PomFactory.eINSTANCE.createAttachmentProperty(); ap.setOwnPosition(AttachmentOwnPosition.RIGHT); ap.setAttachmentSpecification((AttachmentSpecification)EcoreUtil.copy(spr.getAttachmentSpecification())); lpl.add(ap); } private static void setLeftPropertyFromStyle(EList<LayoutDataProperty> lpl, StylePropertyLeft spr) {
private static void setLeftPropertyFromStyle(EList<LayoutDataProperty> lpl, StylePropertyLeft spr) { for (LayoutDataProperty ldp : lpl) { if (ldp instanceof AttachmentProperty && ((AttachmentProperty)ldp).getOwnPosition().getValue() == AttachmentOwnPosition.LEFT_VALUE) { return; } } AttachmentProperty ap = PomFactory.eINSTANCE.createAttachmentProperty(); ap.setOwnPosition(AttachmentOwnPosition.LEFT); ap.setAttachmentSpecification((AttachmentSpecification)EcoreUtil.copy(spr.getAttachmentSpecification())); lpl.add(ap); }
private static void setTopPropertyFromStyle(EList<LayoutDataProperty> lpl, StylePropertyTop spr) { for (LayoutDataProperty ldp : lpl) { if (ldp instanceof AttachmentProperty && ((AttachmentProperty)ldp).getOwnPosition().getValue() == AttachmentOwnPosition.TOP_VALUE) { return; } } AttachmentProperty ap = PomFactory.eINSTANCE.createAttachmentProperty(); ap.setOwnPosition(AttachmentOwnPosition.TOP); ap.setAttachmentSpecification((AttachmentSpecification)EcoreUtil.copy(spr.getAttachmentSpecification())); lpl.add(ap); }
private static void setBottomPropertyFromStyle(EList<LayoutDataProperty> lpl, StylePropertyBottom spr) { for (LayoutDataProperty ldp : lpl) { if (ldp instanceof AttachmentProperty && ((AttachmentProperty)ldp).getOwnPosition().getValue() == AttachmentOwnPosition.BOTTOM_VALUE) { return; } } AttachmentProperty ap = PomFactory.eINSTANCE.createAttachmentProperty(); ap.setOwnPosition(AttachmentOwnPosition.BOTTOM); ap.setAttachmentSpecification((AttachmentSpecification)EcoreUtil.copy(spr.getAttachmentSpecification())); lpl.add(ap); }
@SuppressWarnings ( "unchecked" ) @Override public Driver process ( final org.eclipse.scada.configuration.infrastructure.Driver infraDriver, final Map<Node, org.eclipse.scada.configuration.world.Node> nodes ) { final T driver = (T)infraDriver; final S result = createDriver ( driver ); result.setName ( driver.getName () ); result.setPassword ( EcoreUtil.copy ( Worlds.findCommonDriverPassword ( driver ) ) ); final Endpoint ep = Endpoints.registerEndpoint ( nodes.get ( driver.getNode () ), driver.getPortNumber (), Endpoints.reference ( result ), String.format ( "Driver Endpoint: %s", driver.getName () ) ); result.getEndpoints ().add ( ep ); return result; }
@Override public Driver createDriver ( final World world, final AbstractFactoryDriver infraDriver, final Map<Node, org.eclipse.scada.configuration.world.Node> nodes ) { final T driver = createDriver (); driver.setPassword ( EcoreUtil.copy ( Worlds.findCommonDriverPassword ( (org.eclipse.scada.configuration.infrastructure.CommonDriver)infraDriver ) ) ); final Endpoint ep = Endpoints.registerEndpoint ( nodes.get ( infraDriver.getNode () ), ( (org.eclipse.scada.configuration.infrastructure.CommonDriver)infraDriver ).getPortNumber (), Endpoints.reference ( driver ), "CommonDriver Endpoint: " + driver.getName () ); driver.getEndpoints ().add ( ep ); configureDriver ( world, infraDriver, driver ); return driver; }
private Operation buildSourceOperation(Operation operation, TransformInfo info) { try { EObject originalParam = (EObject) operation.getParameters()[0]; EObject copy = EcoreUtil.copy(originalParam); BeanUtils.setProperty(copy, "outputFormat", info.getSourceFormat()); final Operation sourceOperation = new Operation(operation.getId(), operation.getService(), operation.getMethod(), new Object[] { copy }); return sourceOperation; } catch (Exception e) { throw new WFSException( "Failed to create the source operation for XSLT, this is unexpected", e); } }