Validate script combination.

@param scriptTypes          current point script types
@param lepMethod            executed LEP method
@param compositeResourceKey used only for informative exception message
967834
public static void validateScriptsCombination(Set<XmLepResourceSubType> scriptTypes,
                                                  LepMethod lepMethod,
                                                  UrlLepResourceKey compositeResourceKey) {
        byte mask = getCombinationMask(scriptTypes, lepMethod, compositeResourceKey);

        StringBuilder errors = new StringBuilder();
        if (isZero(mask, ZERO_PATTERN_NO_TENANT_AND_DEFAULT_AND_JAVA_CODE)) {
            errors.append(String.format("Has no one script of '%s', '%s' or native (java) implementation.",
                                        XmLepResourceSubType.TENANT, XmLepResourceSubType.DEFAULT));
        }

        if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_BEFORE)) {
            if (errors.length() > 0) {
                errors.append(" ");
            }

            errors.append(String.format("Has '%s' script with '%s'.", XmLepResourceSubType.BEFORE, XmLepResourceSubType.AROUND));
        }

        if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_AFTER)) {
            if (errors.length() > 0) {
                errors.append(" ");
            }

            errors.append(String.format("Has '%s' script with '%s'.", XmLepResourceSubType.AROUND, XmLepResourceSubType.AFTER));
        }

        if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_TENANT)) {
            if (errors.length() > 0) {
                errors.append(" ");
            }

            errors.append(String.format("Unallowed combination '%s' and '%s' scripts.", XmLepResourceSubType.AROUND, XmLepResourceSubType.TENANT));
        }

        if (errors.length() > 0) {
            throw new IllegalArgumentException(String.format("Resource key %s has script combination errors. %s",
                                                             compositeResourceKey,
                                                             errors.toString()));

        }
    }
561618
private void fillCompositeWithGivenValues(CompositeType pType, Map<String, Object> pCompositeValues, Map<String, Object> pSourceJson) {
        for (Map.Entry<String,Object> entry : pSourceJson.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();

            if (!pType.containsKey(key)) {
                throw new IllegalArgumentException(
                        "Conversion to CompositeType failed because " + key + " is not known as composite attribute key.");
            }
            if (value != null) {
                Object convertedValue = getDispatcher().convertToObject(pType.getType(key),value);
                pCompositeValues.put(key, convertedValue);
            }
        }
    }
889887
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlBehavior == null) {
			this.sarlBehavior = SarlFactory.eINSTANCE.createSarlBehavior();
			script.getXtendTypes().add(this.sarlBehavior);
			this.sarlBehavior.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlBehavior.setName(name);
			}
		}
	}
1142744
public void actionChtype() throws JspException {

        int plainId;
        try {
            plainId = OpenCms.getResourceManager().getResourceType(
                CmsResourceTypePlain.getStaticTypeName()).getTypeId();
        } catch (CmsLoaderException e) {
            // this should really never happen
            plainId = CmsResourceTypePlain.getStaticTypeId();
        }
        try {
            int newType = plainId;
            try {
                // get new resource type id from request
                newType = Integer.parseInt(getParamSelectedType());
            } catch (NumberFormatException nf) {
                throw new CmsException(Messages.get().container(Messages.ERR_GET_RESTYPE_1, getParamSelectedType()));
            }
            // check the resource lock state
            checkLock(getParamResource());
            // change the resource type
            getCms().chtype(getParamResource(), newType);
            // close the dialog window
            actionCloseDialog();
        } catch (Throwable e) {
            // error changing resource type, show error dialog
            includeErrorpage(this, e);
        }
    }
539033
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString image_name_validator = new MPSString();
		image_name_validator.setConstraintIsReq(MPSConstants.GENERIC_CONSTRAINT, true);
		image_name_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		image_name_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		image_name_validator.validate(operationType, image_name, "\"image_name\"");
		
		MPSString doc_file_validator = new MPSString();
		doc_file_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		doc_file_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		doc_file_validator.validate(operationType, doc_file, "\"doc_file\"");
		
	}
613542
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSBoolean ntpd_status_validator = new MPSBoolean();
		ntpd_status_validator.validate(operationType, ntpd_status, "\"ntpd_status\"");
		
	}
674333
function validateTypeAmong(startPos, endPos, x, types) {
  /* Succeed if the type of x is in the list 'types' */
  for (let type of types) {
    if (joinTypes(x.type(), type) !== null) {
      return;
    }
  }
  /* Report error */
  fail(startPos, endPos,
    'expected-value-of-some-type-but-got', [
      types,
      x.type()
    ]
  );
}
494220
public static void verify (@Nullable final String sStr, @Nonnull final ECodepointProfile eProfile)
  {
    if (sStr != null)
      verify (new CodepointIteratorCharSequence (sStr), eProfile);
  }
71694
function validateContentType(cb) {
        if (!_.isUndefined(kontx.args.meta) && !_.isUndefined(kontx.args.meta.type)) {
            db.contentTypes.getById(kontx.args.meta.type.toString()).then(
                function(contentType) {
                    cb(null, contentType);
                },
                function() {
                    cb(createError(400, messages.invalid_content_type));
                });
        } else {
            cb(createError(400, messages.invalid_content_type));
        }

    }
1279304
private void joinAndStoreCompositeResourcebundle(CompositeResourceBundle composite) {

		stopProcessIfNeeded();

		BundleProcessingStatus status = new BundleProcessingStatus(BundleProcessingStatus.FILE_PROCESSING_TYPE,
				composite, resourceHandler, config);

		// Collect all variant names from child bundles
		Map<String, VariantSet> compositeBundleVariants = new HashMap<>();
		for (JoinableResourceBundle childbundle : composite.getChildBundles()) {
			if (childbundle.getVariants() != null)
				compositeBundleVariants = VariantUtils.concatVariants(compositeBundleVariants,
						childbundle.getVariants());
		}
		composite.setVariants(compositeBundleVariants);

		if (needToSearchForVariantInPostProcess || hasVariantPostProcessor(composite)) {
			status.setSearchingPostProcessorVariants(true);
			joinAndPostProcessBundle(composite, status);

			Map<String, VariantSet> postProcessVariants = status.getPostProcessVariants();
			if (!postProcessVariants.isEmpty()) {
				if (LOGGER.isDebugEnabled()) {
					LOGGER.debug(
							"Post process variants found for bundle " + composite.getId() + ":" + postProcessVariants);
				}
				Map<String, VariantSet> newVariants = VariantUtils.concatVariants(composite.getVariants(),
						postProcessVariants);
				composite.setVariants(newVariants);
				status.setSearchingPostProcessorVariants(false);
				joinAndPostProcessBundle(composite, status);
			}
		} else {
			status.setSearchingPostProcessorVariants(false);
			joinAndPostProcessBundle(composite, status);
		}
	}
546917
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSLong exporter_id_validator = new MPSLong();
		exporter_id_validator.validate(operationType, exporter_id, "\"exporter_id\"");
		
		MPSLong priority_validator = new MPSLong();
		priority_validator.validate(operationType, priority, "\"priority\"");
		
		MPSLong timestamp_validator = new MPSLong();
		timestamp_validator.validate(operationType, timestamp, "\"timestamp\"");
		
		MPSString hostname_validator = new MPSString();
		hostname_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		hostname_validator.validate(operationType, hostname, "\"hostname\"");
		
		MPSString process_name_validator = new MPSString();
		process_name_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		process_name_validator.validate(operationType, process_name, "\"process_name\"");
		
		MPSString module_validator = new MPSString();
		module_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		module_validator.validate(operationType, module, "\"module\"");
		
		MPSString type_validator = new MPSString();
		type_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		type_validator.validate(operationType, type, "\"type\"");
		
		MPSString syslog_msg_validator = new MPSString();
		syslog_msg_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 2000);
		syslog_msg_validator.validate(operationType, syslog_msg, "\"syslog_msg\"");
		
		MPSLong sequence_no_validator = new MPSLong();
		sequence_no_validator.validate(operationType, sequence_no, "\"sequence_no\"");
		
		MPSLong datarecord_rx_time_validator = new MPSLong();
		datarecord_rx_time_validator.validate(operationType, datarecord_rx_time, "\"datarecord_rx_time\"");
		
		MPSBoolean decoded_validator = new MPSBoolean();
		decoded_validator.validate(operationType, decoded, "\"decoded\"");
		
		MPSString group_name_validator = new MPSString();
		group_name_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		group_name_validator.validate(operationType, group_name, "\"group_name\"");
		
		MPSString sessionId_validator = new MPSString();
		sessionId_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		sessionId_validator.validate(operationType, sessionId, "\"sessionId\"");
		
		MPSString username_validator = new MPSString();
		username_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		username_validator.validate(operationType, username, "\"username\"");
		
		MPSString clientip_validator = new MPSString();
		clientip_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		clientip_validator.validate(operationType, clientip, "\"clientip\"");
		
		MPSString vserverip_validator = new MPSString();
		vserverip_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		vserverip_validator.validate(operationType, vserverip, "\"vserverip\"");
		
		MPSString vserverport_validator = new MPSString();
		vserverport_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		vserverport_validator.validate(operationType, vserverport, "\"vserverport\"");
		
		MPSString nat_ip_validator = new MPSString();
		nat_ip_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		nat_ip_validator.validate(operationType, nat_ip, "\"nat_ip\"");
		
		MPSString sourceip_validator = new MPSString();
		sourceip_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		sourceip_validator.validate(operationType, sourceip, "\"sourceip\"");
		
		MPSString sourceport_validator = new MPSString();
		sourceport_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		sourceport_validator.validate(operationType, sourceport, "\"sourceport\"");
		
		MPSString destinationip_validator = new MPSString();
		destinationip_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		destinationip_validator.validate(operationType, destinationip, "\"destinationip\"");
		
		MPSString destinationport_validator = new MPSString();
		destinationport_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		destinationport_validator.validate(operationType, destinationport, "\"destinationport\"");
		
		MPSString starttime_validator = new MPSString();
		starttime_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		starttime_validator.validate(operationType, starttime, "\"starttime\"");
		
		MPSString endtime_validator = new MPSString();
		endtime_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		endtime_validator.validate(operationType, endtime, "\"endtime\"");
		
		MPSString duration_validator = new MPSString();
		duration_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		duration_validator.validate(operationType, duration, "\"duration\"");
		
		MPSString totalBytesSend_validator = new MPSString();
		totalBytesSend_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalBytesSend_validator.validate(operationType, totalBytesSend, "\"totalBytesSend\"");
		
		MPSString totalBytesRecv_validator = new MPSString();
		totalBytesRecv_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalBytesRecv_validator.validate(operationType, totalBytesRecv, "\"totalBytesRecv\"");
		
		MPSString totalCompressedBytesSend_validator = new MPSString();
		totalCompressedBytesSend_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalCompressedBytesSend_validator.validate(operationType, totalCompressedBytesSend, "\"totalCompressedBytesSend\"");
		
		MPSString totalCompressedBytesRecv_validator = new MPSString();
		totalCompressedBytesRecv_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalCompressedBytesRecv_validator.validate(operationType, totalCompressedBytesRecv, "\"totalCompressedBytesRecv\"");
		
		MPSString compressionRatioSend_validator = new MPSString();
		compressionRatioSend_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		compressionRatioSend_validator.validate(operationType, compressionRatioSend, "\"compressionRatioSend\"");
		
		MPSString compressionRatioRecv_validator = new MPSString();
		compressionRatioRecv_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		compressionRatioRecv_validator.validate(operationType, compressionRatioRecv, "\"compressionRatioRecv\"");
		
		MPSString domainname_validator = new MPSString();
		domainname_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		domainname_validator.validate(operationType, domainname, "\"domainname\"");
		
		MPSString applicationName_validator = new MPSString();
		applicationName_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		applicationName_validator.validate(operationType, applicationName, "\"applicationName\"");
		
		MPSString browserType_validator = new MPSString();
		browserType_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		browserType_validator.validate(operationType, browserType, "\"browserType\"");
		
		MPSString clientType_validator = new MPSString();
		clientType_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		clientType_validator.validate(operationType, clientType, "\"clientType\"");
		
		MPSString logoutMethod_validator = new MPSString();
		logoutMethod_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		logoutMethod_validator.validate(operationType, logoutMethod, "\"logoutMethod\"");
		
		MPSString vpnaccess_validator = new MPSString();
		vpnaccess_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		vpnaccess_validator.validate(operationType, vpnaccess, "\"vpnaccess\"");
		
		MPSString deniedURL_validator = new MPSString();
		deniedURL_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		deniedURL_validator.validate(operationType, deniedURL, "\"deniedURL\"");
		
		MPSString deniedByPolicy_validator = new MPSString();
		deniedByPolicy_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		deniedByPolicy_validator.validate(operationType, deniedByPolicy, "\"deniedByPolicy\"");
		
		MPSString remote_host_validator = new MPSString();
		remote_host_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		remote_host_validator.validate(operationType, remote_host, "\"remote_host\"");
		
		MPSString xdatalen_validator = new MPSString();
		xdatalen_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		xdatalen_validator.validate(operationType, xdatalen, "\"xdatalen\"");
		
		MPSString xdata_validator = new MPSString();
		xdata_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		xdata_validator.validate(operationType, xdata, "\"xdata\"");
		
		MPSString last_contact_validator = new MPSString();
		last_contact_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		last_contact_validator.validate(operationType, last_contact, "\"last_contact\"");
		
		MPSString httpResourceName_validator = new MPSString();
		httpResourceName_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		httpResourceName_validator.validate(operationType, httpResourceName, "\"httpResourceName\"");
		
		MPSString licenselmt_validator = new MPSString();
		licenselmt_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		licenselmt_validator.validate(operationType, licenselmt, "\"licenselmt\"");
		
		MPSString connectionId_validator = new MPSString();
		connectionId_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		connectionId_validator.validate(operationType, connectionId, "\"connectionId\"");
		
		MPSString clisecexp_validator = new MPSString();
		clisecexp_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		clisecexp_validator.validate(operationType, clisecexp, "\"clisecexp\"");
		
		MPSString eval_value_validator = new MPSString();
		eval_value_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		eval_value_validator.validate(operationType, eval_value, "\"eval_value\"");
		
		MPSString httpResourcesAccessed_validator = new MPSString();
		httpResourcesAccessed_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		httpResourcesAccessed_validator.validate(operationType, httpResourcesAccessed, "\"httpResourcesAccessed\"");
		
		MPSString nonhttpServicesAccessed_validator = new MPSString();
		nonhttpServicesAccessed_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		nonhttpServicesAccessed_validator.validate(operationType, nonhttpServicesAccessed, "\"nonhttpServicesAccessed\"");
		
		MPSString totalTCPconnections_validator = new MPSString();
		totalTCPconnections_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalTCPconnections_validator.validate(operationType, totalTCPconnections, "\"totalTCPconnections\"");
		
		MPSString totalUDPflows_validator = new MPSString();
		totalUDPflows_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalUDPflows_validator.validate(operationType, totalUDPflows, "\"totalUDPflows\"");
		
		MPSString totalPoliciesAllowed_validator = new MPSString();
		totalPoliciesAllowed_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalPoliciesAllowed_validator.validate(operationType, totalPoliciesAllowed, "\"totalPoliciesAllowed\"");
		
		MPSString totalPoliciesDenied_validator = new MPSString();
		totalPoliciesDenied_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 255);
		totalPoliciesDenied_validator.validate(operationType, totalPoliciesDenied, "\"totalPoliciesDenied\"");
		
		MPSString id_validator = new MPSString();
		id_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);
		id_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		id_validator.validate(operationType, id, "\"id\"");
		
	}
179882
void validatePackage(EntityType entityType) {
    Package pack = entityType.getPackage();
    if (pack != null
        && isSystemPackage(pack)
        && !systemEntityTypeRegistry.hasSystemEntityType(entityType.getId())) {
      throw new MolgenisValidationException(
          new ConstraintViolation(
              format(
                  "Adding entity [%s] to system package [%s] is not allowed",
                  entityType.getId(), pack.getId())));
    }
  }
1057054
public void eInit(SarlScript script, String name, IJvmTypeProvider context) {
		setTypeResolutionContext(context);
		if (this.sarlEnumeration == null) {
			this.container = script;
			this.sarlEnumeration = SarlFactory.eINSTANCE.createSarlEnumeration();
			script.getXtendTypes().add(this.sarlEnumeration);
			this.sarlEnumeration.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration());
			if (!Strings.isEmpty(name)) {
				this.sarlEnumeration.setName(name);
			}
		}
	}
119493
public static void checkContentResourceType(NodeType contentNodeType) throws NoSuchNodeTypeException
   {
      if (!contentNodeType.isNodeType(WebDavConst.NodeTypes.NT_RESOURCE))
      {
         throw new NoSuchNodeTypeException("Content-Node type " + contentNodeType.getName()
            + " must extend nt:resource.");
      }
   }
19820
private void validateResource(List<ValidationMessage> errors, WrapperElement resource, WrapperElement element, StructureDefinition profile, IdStatus idstatus, NodeStack stack) throws FHIRException {
    if (stack == null)
      stack = new NodeStack(element.isXml());
		if (resource == null)
			resource = element;

    // getting going - either we got a profile, or not.
    boolean ok = true;
    if (element.isXml()) {
      ok = rule(errors, IssueType.INVALID, element.line(), element.col(), "/", element.getNamespace().equals(FormatUtilities.FHIR_NS),
          "Namespace mismatch - expected '" + FormatUtilities.FHIR_NS + "', found '" + element.getNamespace() + "'");
    }
    if (ok) {
      String resourceName = element.getResourceType();
      if (profile == null) {
        profile = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + resourceName);
        ok = rule(errors, IssueType.INVALID, element.line(), element.col(), stack.addToLiteralPath(resourceName), profile != null, "No profile found for resource type '" + resourceName + "'");
      } else {
        String type = profile.hasConstrainedType() ? profile.getConstrainedType() : profile.getName();
        // special case: we have a bundle, and the profile is not for a bundle. We'll try the first entry instead
        if (!type.equals(resourceName) && resourceName.equals("Bundle")) {
          WrapperElement first = getFirstEntry(element);
          if (first != null && first.getResourceType().equals(type)) {
            element = first;
            resourceName = element.getResourceType();
						idstatus = IdStatus.OPTIONAL; // why?
          }
        }
        ok = rule(errors, IssueType.INVALID, -1, -1, stack.addToLiteralPath(resourceName), type.equals(resourceName),
            "Specified profile type was '" + profile.getConstrainedType() + "', but resource type was '" + resourceName + "'");
      }
    }

    if (ok) {
      stack = stack.push(element, -1, profile.getSnapshot().getElement().get(0), profile.getSnapshot().getElement().get(0));
			if (idstatus == IdStatus.REQUIRED && (element.getNamedChild("id") == null))
				rule(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), false, "Resource requires an id, but none is present");
			else if (idstatus == IdStatus.PROHIBITED && (element.getNamedChild("id") != null))
				rule(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), false, "Resource has an id, but none is allowed");
			start(errors, resource, element, profile, stack); // root is both definition and type
    }
  }
1194624
public String getValidationScript(TestContext context) {
        try {
            if (validationScriptResourcePath != null) {
                return context.replaceDynamicContentInString(FileUtils.readToString(FileUtils.getFileResource(validationScriptResourcePath, context),
                        Charset.forName(context.replaceDynamicContentInString(validationScriptResourceCharset))));
            } else if (validationScript != null) {
                return context.replaceDynamicContentInString(validationScript);
            } else {
                return "";
            }
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to load validation script resource", e);
        }
    }
643562
public void setResourceType(String resourceType) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(resourceType)) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_VALUE_EMPTY_0));
        }
        m_resourceType = resourceType;
    }