Verify the schema.

<p>
Verify if the FeatureCollection contains all the needed fields.
</p>
@param schema is yhe type for the project mode.
@param pm
@return true if there is the percentage of the area.
439694
public static boolean verifyProjectType( SimpleFeatureType schema, IHMProgressMonitor pm ) {
        String searchedField = PipesTrentoP.ID.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.DRAIN_AREA.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.INITIAL_ELEVATION.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.FINAL_ELEVATION.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.RUNOFF_COEFFICIENT.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.KS.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.MINIMUM_PIPE_SLOPE.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.AVERAGE_RESIDENCE_TIME.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.PIPE_SECTION_TYPE.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.AVERAGE_SLOPE.getAttributeName();
        verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm);
        searchedField = PipesTrentoP.PER_AREA.getAttributeName();
        String attributeName = findAttributeName(schema, searchedField);
        if (attributeName != null) {
            return true;
        }

        return false;

    }
647189
private boolean hasOperationOfType(SQLiteDatabaseSchema schema, MethodSpec.Builder methodBuilder, JQLType jqlType) {
		boolean hasOperation = false;
		for (SQLiteDaoDefinition daoDefinition : schema.getCollection()) {

			if (daoDefinition.getElement().getAnnotation(BindContentProviderPath.class) == null)
				continue;

			for (SQLiteModelMethod daoMethod : daoDefinition.getCollection()) {
				if (daoMethod.jql.operationType != jqlType) {
					continue;
				}
				if (!daoMethod.hasAnnotation(BindContentProviderEntry.class)) {
					continue;
				}

				hasOperation = true;
				// methodBuilder.addJavadoc("method $L.$L\n",
				// daoDefinition.getName(), daoMethod.getName());
			}
		}
		return hasOperation;
	}
1292764
public Search validate(Schema schema) {
        filter.forEach(condition -> condition.query(schema));
        query.forEach(condition -> condition.query(schema));
        sort.forEach(field -> field.sortField(schema));
        return this;
    }
669301
@Override
	public boolean hasField(String fldName) {
		return ts.hasField(fldName) || s.hasField(fldName);
	}
1023967
public static Schema subSetOf(Schema schema, String... subSetFields) {
		return subSetOf("subSetSchema" + (COUNTER++), schema, subSetFields);
	}
1350339
public static void set(String schemaPattern, Set<String> keywords) {
		SCHEMA_PATTERN = Pattern.compile(schemaPattern);

		KEYWORDS.clear();
		KEYWORDS.addAll(keywords);
	}
759966
private boolean isMap(PropertyPath path) {
        if (schemaRoot != null) {
            Schema schema = this.schemaRoot.find(path);
            return schema != null && (schema.hasChild(NodeId.ANY_KEY) || schema.hasChild(NodeId.ANY));
        }
        return false;
    }
1132518
private void validateSchema(Schema schema) throws DDFException {
    Set<String> columnSet = new HashSet<String>();
    if(schema != null && schema.getColumns() != null) {
      for (Column column : schema.getColumns()) {
        if (columnSet.contains(column.getName())) {
          throw new DDFException(String.format("Duplicated column name %s", column.getName()));
        } else {
          columnSet.add(column.getName());
        }
      }
    }
  }
1348168
public boolean canValidate(Document doc) {
        XsdSchema schema = schemaMappingStrategy.getSchema(schemas, doc);
        return schema != null;
    }
1029083
public boolean compileFromSchemaAndClasses(
            final List<File> schemaPaths,
            final List<File> classesJarPaths,
            final File catalogOutputPath)
    {
        if (schemaPaths != null && !schemaPaths.stream().allMatch(File::exists)) {
            compilerLog.error("Cannot compile nonexistent or missing schema.");
            return false;
        }

        List<VoltCompilerReader> ddlReaderList;
        try {
            if (schemaPaths == null || schemaPaths.isEmpty()) {
                ddlReaderList = new ArrayList<>(1);
                ddlReaderList.add(new VoltCompilerStringReader(AUTOGEN_DDL_FILE_NAME, m_emptyDDLComment));
            } else {
                ddlReaderList = DDLPathsToReaderList(
                        schemaPaths.stream().map(File::getAbsolutePath).toArray(String[]::new));
            }
        }
        catch (VoltCompilerException e) {
            compilerLog.error("Unable to open schema file \"" + schemaPaths + "\"", e);
            return false;
        }

        InMemoryJarfile inMemoryUserJar = new InMemoryJarfile();
        ClassLoader originalClassLoader = m_classLoader;
        try {
            m_classLoader = inMemoryUserJar.getLoader();
            if (classesJarPaths != null) {
                // Make user's classes available to the compiler and add all VoltDB artifacts to theirs (overwriting any existing VoltDB artifacts).
                // This keeps all their resources because stored procedures may depend on them.
                for (File classesJarPath: classesJarPaths) {
                    if (classesJarPath.exists()) {
                        InMemoryJarfile jarFile = new InMemoryJarfile(classesJarPath);
                        inMemoryUserJar.putAll(jarFile);
                    }
                }
            }
            if (compileInternal(null, null, ddlReaderList, inMemoryUserJar) == null) {
                return false;
            }
        } catch (IOException e) {
            compilerLog.error("Could not load classes from user supplied jar file", e);
            return false;
        } finally {
            m_classLoader = originalClassLoader;
        }

        try {
            inMemoryUserJar.writeToFile(catalogOutputPath).run();
            return true;
        }
        catch (final Exception e) {
            e.printStackTrace();
            addErr("Error writing catalog jar to disk: " + e.getMessage());
            return false;
        }
    }
1184519
public static boolean hasGeometryField(ResultSet resultSet) throws SQLException {
        ResultSetMetaData meta = resultSet.getMetaData();
        int columnCount = meta.getColumnCount();
        for (int i = 1; i <= columnCount; i++) {
            if (meta.getColumnTypeName(i).equalsIgnoreCase("geometry")) {
                return true;
            }
        }
        return false;
    }
974351
private void performSchemaValidation(Message receivedMessage, JsonMessageValidationContext validationContext) {
        log.debug("Starting Json schema validation ...");

        ProcessingReport report = jsonSchemaValidation.validate(receivedMessage,
                                                                schemaRepositories,
                                                                validationContext,
                                                                applicationContext);
        if (!report.isSuccess()) {
            log.error("Failed to validate Json schema for message:\n" + receivedMessage.getPayload(String.class));

            throw new ValidationException(constructErrorMessage(report));
        }

        log.info("Json schema validation successful: All values OK");
    }
774030
public static boolean isBigDecimal(Schema schema) {
        if (Type.BYTES == schema.getType()) {
            JsonNode logicalTypeNode = schema.getJsonProp("logicalType");
            if (logicalTypeNode != null
                    && "decimal".equals(logicalTypeNode.asText())) {
                return true;
            }
        }
        return false;
    }
652821
def schematron_validate(mets_doc, schematron=AM_SCT_PATH):
    
    if isinstance(schematron, six.string_types):
        schematron = get_schematron(schematron)
    is_valid = schematron.validate(mets_doc)
    report = schematron.validation_report
    return is_valid, report
611500
public void checkSchemaUpdateOrGrantRights(String schemaName) {

        if (!hasSchemaUpdateOrGrantRights(schemaName)) {
            throw Error.error(ErrorCode.X_42501, schemaName);
        }
    }
451552
public static boolean isSupportedSchema(Schema s) {
    Schema.Type typ =  s.getType();
    switch (typ) {
      case BOOLEAN:
      case INT:
      case LONG:
      case FLOAT:
      case DOUBLE:
      case ENUM:
      case STRING:
      case NULL:
      case BYTES:
        return true;
      case UNION: // Flattenize the union
        List<Schema> unionSchemas = s.getTypes();
        if (unionSchemas.size() == 1) {
          return isSupportedSchema(unionSchemas.get(0));
        } else if (unionSchemas.size() == 2) {
          Schema s1 = unionSchemas.get(0);
          Schema s2 = unionSchemas.get(1);
          return s1.getType().equals(Schema.Type.NULL) && isSupportedSchema(s2)
                 || s2.getType().equals(Schema.Type.NULL) && isSupportedSchema(s1);
        }
      default:
        return false;
    }
  }
935298
public static boolean isInternalId(String schema) {

        String translatedId = translateLegacySystemId(schema);
        if (translatedId.startsWith(INTERNAL_SCHEME)) {
            return true;
        }
        return false;
    }