! @brief Generates and populates the target defined by a CmsisPackDevice.

        The new target class is added to the `#TARGET` list.

        @param dev A CmsisPackDevice object.
332932
def populate_device(dev):
        
        try:
            tgt = PackTargets._generate_pack_target_class(dev)
            if tgt is None:
                return
            part = dev.part_number.lower()
            LOG.debug("Loading target '%s' from CMSIS-Pack", part)

            # Make sure there isn't a duplicate target name.
            if part not in TARGET:
                TARGET[part] = tgt
        except (MalformedCmsisPackError, FileNotFoundError_) as err:
            LOG.warning(err)
777430
def generate_builder(self, entry_point, export_target):
        

        try:
            builder = entry_point.resolve()
        except ImportError:
            logger.error(
                "unable to import the target builder for the entry point "
                "'%s' from package '%s' to generate artifact '%s'",
                entry_point, entry_point.dist, export_target,
            )
            return

        if not self.verify_builder(builder):
            logger.error(
                "the builder referenced by the entry point '%s' "
                "from package '%s' has an incompatible signature",
                entry_point, entry_point.dist,
            )
            return

        # CLEANUP see deprecation notice below
        verifier = self.verify_export_target(export_target)
        if not verifier:
            logger.error(
                "the export target '%s' has been rejected", export_target)
            return

        toolchain, spec = self.extract_builder_result(builder(
            [entry_point.dist.project_name], export_target=export_target))
        if not toolchain:
            logger.error(
                "the builder referenced by the entry point '%s' "
                "from package '%s' failed to produce a valid "
                "toolchain",
                entry_point, entry_point.dist,
            )
            return

        if spec.get(EXPORT_TARGET) != export_target:
            logger.error(
                "the builder referenced by the entry point '%s' "
                "from package '%s' failed to produce a spec with the "
                "expected export_target",
                entry_point, entry_point.dist,
            )
            return

        if callable(verifier):
            warnings.warn(
                "%s:%s.verify_export_target returned a callable, which "
                "will no longer be passed to spec.advise by calmjs-4.0.0; "
                "please instead override 'setup_export_location' or "
                "'prepare_export_location' in that class" % (
                    self.__class__.__module__, self.__class__.__name__),
                DeprecationWarning
            )
            spec.advise(BEFORE_PREPARE, verifier, export_target)
        else:
            spec.advise(
                BEFORE_PREPARE,
                self.prepare_export_location, export_target)
        yield entry_point, toolchain, spec
513176
private Map < String, String > generateConverterClasses(
            String xmlSchemaSource, String targetPackageName) {

        log.debug("Converter support classes generation started");
        Map < String, String > codeMap = xsd2CobolTypes.generate(
                new StringReader(xmlSchemaSource), targetPackageName);
        if (log.isDebugEnabled()) {
            log.debug("Generated converter support classes: ");
            for (String code : codeMap.values()) {
                log.debug(code);
                log.debug("\n");
            }
        }
        log.debug("Converter support classes generation ended");
        return codeMap;
    }
270406
public void build(final DeviceImpl device, final Object businessObject, final Method m, final boolean isOnDeviceImpl)
            throws DevFailed {
        xlogger.entry();
        final Command annot = m.getAnnotation(Command.class);
        // retrieve parameter type
        final Class<?>[] paramTypeTable = m.getParameterTypes();
        if (paramTypeTable.length > 1) {
            throw DevFailedUtils.newDevFailed("INIT_FAILED", "Command can have only one parameter");
        }
        Class<?> paramType;
        if (paramTypeTable.length == 0) {
            paramType = Void.class;
        } else {
            paramType = paramTypeTable[0];
        }
        // retrieve returned type
        final Class<?> returnedType = m.getReturnType();
        // logger
        // .debug("get returned type of cmd {}", returnedType
        // .getCanonicalName());
        String cmdName;
        if ("".equals(annot.name())) {
            cmdName = m.getName();
        } else {
            cmdName = annot.name();
        }
        logger.debug("Has a command: {} type {}", cmdName, paramType.getCanonicalName());
        final CommandConfiguration config = new CommandConfiguration(cmdName, paramType, returnedType,
                annot.inTypeDesc(), annot.outTypeDesc(), DispLevel.from_int(annot.displayLevel()), annot.isPolled(),
                annot.pollingPeriod());

        ReflectCommandBehavior behavior = null;
        if (isOnDeviceImpl) {
            behavior = new ReflectCommandBehavior(m, device, config);

        } else {
            behavior = new ReflectCommandBehavior(m, businessObject, config);
        }
        final CommandImpl command = new CommandImpl(behavior, device.getName());
        BuilderUtils.setStateMachine(m, command);
        device.addCommand(command);
        xlogger.exit();
    }
955610
public void setTargetForlder(CmsResource resource) {

        if (resource.isFolder()) {
            if (m_context.getResources().size() == 1) {
                try {
                    if (m_dialogMode.equals(DialogMode.copy)
                        | (m_dialogMode.equals(DialogMode.copy_and_move)
                            && CmsResource.getParentFolder(m_context.getResources().get(0).getRootPath()).equals(
                                resource.getRootPath()))) {
                        m_targetPath.setValue(getTargetName(m_context.getResources().get(0), resource));
                    } else {

                        m_targetPath.setValue(
                            getCms().getSitePath(resource) + getTargetName(m_context.getResources().get(0), resource));
                    }
                } catch (CmsException e) {
                    m_targetPath.setValue(getCms().getSitePath(resource));
                }
            } else {
                m_targetPath.setValue(getCms().getSitePath(resource));
            }

            updateDefaultActions(resource.getRootPath());
        } else {
            throw new CmsIllegalArgumentException(
                org.opencms.workplace.commons.Messages.get().container(
                    org.opencms.workplace.commons.Messages.ERR_COPY_MULTI_TARGET_NOFOLDER_1,
                    A_CmsUI.getCmsObject().getSitePath(resource)));
        }
    }
481965
@EventListener(classes = TargetDeletedEvent.class)
    protected void targetDelete(final TargetDeletedEvent deleteEvent) {
        if (isNotFromSelf(deleteEvent)) {
            return;
        }
        sendDeleteMessage(deleteEvent.getTenant(), deleteEvent.getControllerId(), deleteEvent.getTargetAddress());
    }
1365753
public void addConfiguredTarget(final TargetDef target) {
    if (target == null) {
      throw new NullPointerException("target");
    }
    target.setProject(getProject());
    this.targetPlatforms.addElement(target);
  }
337644
protected synchronized void createTarget(Servlet s) throws InjectionException{ //596191
        if (s instanceof SingleThreadModel) {
            isSTM = true;
            servletConfig.setSingleThreadModelServlet(isSTM);
            target = new SingleThreadModelServlet(s.getClass());
        } else {
            target = s;
        }
    }
619038
protected void _generate(SarlSkill skill, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(skill);
		final PyAppendable appendable = createAppendable(jvmType, context);

		List<JvmTypeReference> superTypes = getSuperTypes(skill.getExtends(), skill.getImplements());
		if (superTypes.isEmpty()) {
			superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Skill.class, skill));
		}
		final String qualifiedName = this.qualifiedNameProvider.getFullyQualifiedName(skill).toString();
		if (generateTypeDeclaration(
				qualifiedName,
				skill.getName(), skill.isAbstract(), superTypes,
				getTypeBuilder().getDocumentation(skill),
				true,
				skill.getMembers(), appendable, context, (it, context2) -> {
				generateGuardEvaluators(qualifiedName, it, context2);
			})) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(skill);
			writeFile(name, appendable, context);
		}
	}
699136
function generate(spec) {
  createProjectDirectory();
  spec = addHttpEndpointNames(spec);
  spec = addSocketEndpointFlag(spec);
  spec = addSocketEmitTypeFlag(spec);
  spec = isProxyEndpointAvailable(spec);
  writeFileSync('server.mustache', spec, 'server.js');
  writeFileSync('package.mustache', spec, 'package.json');
}
254312
public void updateTarget() {
        /* save updated entity */
        final Target target = targetManagement.update(entityFactory.target().update(controllerId)
                .name(nameTextField.getValue()).description(descTextArea.getValue()));
        /* display success msg */
        uINotification.displaySuccess(i18n.getMessage("message.update.success", target.getName()));
        // publishing through event bus
        eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.UPDATED_ENTITY, target));
    }
164849
def _pack_target_create_init_sequence(self):
        """"""
        seq = super(self.__class__, self).create_init_sequence()
        seq.insert_after('create_cores',
            ('set_default_reset_type', self.set_default_reset_type))
        return seq
1126250
public static void generate() {

		// If the GeoPackage does not exist create it
		if (!geoPackageFile.exists()) {
			if (!GeoPackageManager.create(geoPackageFile)) {
				throw new GeoPackageException(
						"Failed to create GeoPackage file: "
								+ geoPackageFile.getAbsolutePath());
			}
		}

		// Open the GeoPackage
		geoPackage = GeoPackageManager.open(geoPackageFile);

		// Default the EPSG
		if (epsg == null) {
			epsg = new Long(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
		}

		// Set the projection and default bounding box as needed
		Projection bboxProjection = null;
		if (boundingBox != null) {
			bboxProjection = ProjectionFactory.getProjection(epsg);
		} else {
			boundingBox = new BoundingBox();
			bboxProjection = ProjectionFactory
					.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);
		}

		// Bound degree tiles to Web Mercator limits
		if (bboxProjection.isUnit(Units.DEGREES)) {
			boundingBox = TileBoundingBoxUtils
					.boundDegreesBoundingBoxWithWebMercatorLimits(boundingBox);
		}

		// Transform to the URL projection bounding box
		Projection urlProjection = ProjectionFactory.getProjection(urlEpsg);
		ProjectionTransform transform = bboxProjection
				.getTransformation(urlProjection);
		BoundingBox urlBoundingBox = boundingBox.transform(transform);

		UrlTileGenerator tileGenerator = new UrlTileGenerator(geoPackage,
				tileTable, url, minZoom, maxZoom, urlBoundingBox, urlProjection);

		if (compressFormat != null) {
			tileGenerator.setCompressFormat(compressFormat);
			if (compressQuality != null) {
				tileGenerator.setCompressQuality(compressQuality);
			}
		}

		if (googleTiles) {
			tileGenerator.setGoogleTiles(true);
		}

		if (tms) {
			tileGenerator.setTileFormat(TileFormatType.TMS);
		}

		int count = tileGenerator.getTileCount();

		LOGGER.log(
				Level.INFO,
				"GeoPackage: "
						+ geoPackage.getName()
						+ ", Tile Table: "
						+ tileTable
						+ ", URL: "
						+ url
						+ ", Min Zoom: "
						+ minZoom
						+ ", Max Zoom: "
						+ maxZoom
						+ (compressFormat != null ? ", Compress Format: "
								+ compressFormat : "")
						+ (compressQuality != null ? ", Compress Quality: "
								+ compressQuality : "")
						+ (googleTiles ? ", Google Tiles" : "")
						+ (boundingBox != null ? ", Min Lon: "
								+ boundingBox.getMinLongitude() + ", Min Lat: "
								+ boundingBox.getMinLatitude() + ", Max Lon: "
								+ boundingBox.getMaxLongitude() + ", Max Lat: "
								+ boundingBox.getMaxLatitude() : "")
						+ (epsg != null ? ", EPSG: " + epsg : "")
						+ ", URL EPSG: " + urlEpsg + ", Expected Tile Count: "
						+ count);

		tileGenerator.setProgress(progress);

		LOGGER.log(Level.INFO, "Generating Tiles...");

		try {
			tileGenerator.generateTiles();
		} catch (IOException | SQLException e) {
			throw new GeoPackageException("Exception while generating tiles", e);
		}

		finish();
	}
849335
public void populateSelectedTarget(final Target selectedTarget) {
        this.selectedTarget = selectedTarget;
        getDetailsSupport()
                .populateMasterDataAndRecalculateContainer(selectedTarget != null ? selectedTarget.getId() : null);
    }
843142
void generateMBeanCode(Definition def)
   {
      if (def.isSupportOutbound())
      {
         generateClassCode(def, "MbeanInterface", "mbean");
         generateClassCode(def, "MbeanImpl", "mbean");
         generatePackageInfo(def, "main", "mbean");
      }
   }
609083
private void createProject() {

        CmsObject cms = A_CmsUI.getCmsObject();
        try {
            String name = "/";
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldOU.getValue())) {
                name = CmsStringUtil.joinPaths(name, m_fieldOU.getValue());
            }
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_fieldName.getValue())) {
                name = CmsStringUtil.joinPaths(name, m_fieldName.getValue());
            } else {
                name = CmsStringUtil.joinPaths(name, "/");
            }

            m_project = cms.createProject(
                name,
                m_fieldDescription.getValue(),
                m_fieldUser.getValue(),
                m_fieldManager.getValue(),
                m_fieldDeleteAfterPublish.getValue().booleanValue()
                ? CmsProject.PROJECT_TYPE_TEMPORARY
                : CmsProject.PROJECT_TYPE_NORMAL);
            updateProjectResources();

        } catch (Throwable t) {
            CmsErrorDialog.showErrorDialog(t);
        }
    }
849763
protected <T extends MessageOutput> void installOutput(MapBinder<String, MessageOutput.Factory<? extends MessageOutput>> outputMapBinder,
                                                           Class<T> target,
                                                           Class<? extends MessageOutput.Factory<T>> targetFactory) {
        install(new FactoryModuleBuilder().implement(MessageOutput.class, target).build(targetFactory));
        outputMapBinder.addBinding(target.getCanonicalName()).to(Key.get(targetFactory));
    }