Sets the StructTypeInfo that declares the total schema of the file in the configuration
573
public static void setSchemaTypeInfo(Configuration conf, StructTypeInfo schemaTypeInfo) {
    if (schemaTypeInfo != null) {
      conf.set(SCHEMA_TYPE_INFO, schemaTypeInfo.getTypeName());
      LOG.debug("Set schema typeInfo on conf: {}", schemaTypeInfo);
    }
  }
751746
private void updateDocTypesFromConfiguration() {
        resetDocumentTypesAndExtractors();
        JBakeConfiguration config = utensils.getConfiguration();

        ModelExtractorsDocumentTypeListener listener = new ModelExtractorsDocumentTypeListener();
        DocumentTypes.addListener(listener);

        for (String docType : config.getDocumentTypes()) {
            DocumentTypes.addDocumentType(docType);
        }
    }
1167715
def AddDescriptorFromSchema(self, schema_name, schema):
        """"""
        # TODO(craigcitro): Is schema_name redundant?
        if self.__GetDescriptor(schema_name):
            return
        if schema.get('enum'):
            self.__DeclareEnum(schema_name, schema)
            return
        if schema.get('type') == 'any':
            self.__DeclareMessageAlias(schema, 'extra_types.JsonValue')
            return
        if schema.get('type') != 'object':
            raise ValueError('Cannot create message descriptors for type %s' %
                             schema.get('type'))
        message = extended_descriptor.ExtendedMessageDescriptor()
        message.name = self.__names.ClassName(schema['id'])
        message.description = util.CleanDescription(schema.get(
            'description', 'A %s object.' % message.name))
        self.__DeclareDescriptor(message.name)
        with self.__DescriptorEnv(message):
            properties = schema.get('properties', {})
            for index, (name, attrs) in enumerate(sorted(properties.items())):
                field = self.__FieldDescriptorFromProperties(
                    name, index + 1, attrs)
                message.fields.append(field)
                if field.name != name:
                    message.field_mappings.append(
                        type(message).JsonFieldMapping(
                            python_name=field.name, json_name=name))
                    self.__AddImport(
                        'from %s import encoding' % self.__base_files_package)
            if 'additionalProperties' in schema:
                self.__AddAdditionalProperties(message, schema, properties)
        self.__RegisterDescriptor(message)
1058086
public void addTypeTypes(TDefinitions descriptionType)
    {
        if (schemaFactory == null)
            schemaFactory = new org.w3._2001.xmlschema.ObjectFactory();
        
        names.clear();
        TTypes types = wsdlFactory.createTTypes();
        descriptionType.getAnyTopLevelOptionalElement().add(types);
        
        // This code is LAME, but for wsdl1.1, import doesn't work
        org.w3._2001.xmlschema.Schema schema = schemaFactory.createSchema();
        types.getAny().add(schema);
        String strVersion = this.getProperty("version");
        if (strVersion == null)
            strVersion = this.getDefaultVersion();
        schema.setId(this.getMessageControl().getIdFromVersion(strVersion));
        schema.setVersion(this.getMessageControl().getNumericVersionFromVersion(strVersion));
        schema.setElementFormDefault(FormChoice.QUALIFIED);
        this.scanProcesses(types, OperationType.TYPES_OPERATIONS);
    }
601185
public void setDataType(String type)  {
        addField(ConfigureNodeFields.type, FormField.Type.text_single);
        setAnswer(ConfigureNodeFields.type.getFieldName(), type);
    }
49233
public static StructType fromSchema(Schema schema) {
        StructField[] structFields = new StructField[schema.numColumns()];
        for (int i = 0; i < structFields.length; i++) {
            switch (schema.getColumnTypes().get(i)) {
                case Double:
                    structFields[i] = new StructField(schema.getName(i), DataTypes.DoubleType, false, Metadata.empty());
                    break;
                case Integer:
                    structFields[i] =
                                    new StructField(schema.getName(i), DataTypes.IntegerType, false, Metadata.empty());
                    break;
                case Long:
                    structFields[i] = new StructField(schema.getName(i), DataTypes.LongType, false, Metadata.empty());
                    break;
                case Float:
                    structFields[i] = new StructField(schema.getName(i), DataTypes.FloatType, false, Metadata.empty());
                    break;
                default:
                    throw new IllegalStateException(
                                    "This api should not be used with strings , binary data or ndarrays. This is only for columnar data");
            }
        }
        return new StructType(structFields);
    }
875404
def StructureAttribute(struct_info):
    """"""

    # Copy the template and add the gtype
    cls_dict = dict(_Structure.__dict__)
    cls = type(struct_info.name, _Structure.__bases__, cls_dict)
    cls.__module__ = struct_info.namespace
    cls.__gtype__ = PGType(struct_info.g_type)
    cls._size = struct_info.size
    cls._is_gtype_struct = struct_info.is_gtype_struct

    # Add methods
    for method_info in struct_info.get_methods():
        add_method(method_info, cls)

    # Add fields
    for field_info in struct_info.get_fields():
        field_name = escape_identifier(field_info.name)
        attr = FieldAttribute(field_name, field_info)
        setattr(cls, field_name, attr)

    return cls
258231
void setScriptType(int type) {

        // OOo related code
        if (database.isStoredFileAccess()) {
            return;
        }

        // OOo end
        boolean needsCheckpoint = scriptFormat != type;

        scriptFormat = type;

        properties.setProperty(HsqlDatabaseProperties.hsqldb_script_format,
                               String.valueOf(scriptFormat));

        if (needsCheckpoint) {
            database.logger.needsCheckpoint = true;
        }
    }
902168
def set_resource_type(self, klass):
        
        self.resource_type = klass
        self.schema = loaders.load_schema_raw(self.resource_type)
407461
public void setType(String type) throws ApplicationException {
	if (StringUtil.isEmpty(type, true)) return;
	type = type.toLowerCase().trim();

	if (type.equals("url")) param.setType(HttpParamBean.TYPE_URL);
	else if (type.equals("formfield") || type.equals("form")) param.setType(HttpParamBean.TYPE_FORM);
	else if (type.equals("cgi")) param.setType(HttpParamBean.TYPE_CGI);
	else if (type.startsWith("head") || type.startsWith("header")) param.setType(HttpParamBean.TYPE_HEADER);
	else if (type.equals("cookie")) param.setType(HttpParamBean.TYPE_COOKIE);
	else if (type.equals("file")) param.setType(HttpParamBean.TYPE_FILE);
	else if (type.equals("xml")) param.setType(HttpParamBean.TYPE_XML);
	else if (type.equals("body")) param.setType(HttpParamBean.TYPE_BODY);
	else throw new ApplicationException("invalid type [" + type + "], valid types are [body,cgi,cookie,file,form,head,url,xml]");
    }
166756
def set_document_type(loader_cls: Type, type_: Type) -> None:
    
    loader_cls.document_type = type_

    if not hasattr(loader_cls, '_registered_classes'):
        loader_cls._registered_classes = dict()
1127022
static StructrTypeDefinition deserialize(final StructrSchemaDefinition root, final String name, final Map<String, Object> source) {

		final Map<String, StructrPropertyDefinition> deserializedProperties = new TreeMap<>();
		final Map<String, StructrMethodDefinition> deserializedMethods      = new TreeMap<>();
		final StructrTypeDefinition typeDefinition                          = StructrTypeDefinition.determineType(root, name, source);
		final Map<String, Object> properties                                = (Map)source.get(JsonSchema.KEY_PROPERTIES);
		final List<String> requiredPropertyNames                            = (List)source.get(JsonSchema.KEY_REQUIRED);
		final Map<String, Object> views                                     = (Map)source.get(JsonSchema.KEY_VIEWS);
		final Map<String, String> viewOrder                                 = (Map)source.get(JsonSchema.KEY_VIEW_ORDER);
		final Map<String, Object> methods                                   = (Map)source.get(JsonSchema.KEY_METHODS);

		if (properties != null) {

			for (final Entry<String, Object> entry : properties.entrySet()) {

				final String propertyName = entry.getKey();
				final Object value        = entry.getValue();

				if (value instanceof Map) {

					final StructrPropertyDefinition property = StructrPropertyDefinition.deserialize(typeDefinition, propertyName, (Map)value);
					if (property != null) {

						deserializedProperties.put(property.getName(), property);
						typeDefinition.getProperties().add(property);
					}

				} else {

					throw new IllegalStateException("Invalid JSON property definition for property " + propertyName + ", expected object.");
				}
			}
		}

		if (requiredPropertyNames != null) {

			for (final String requiredPropertyName : requiredPropertyNames) {

				// set required properties
				final StructrPropertyDefinition property = deserializedProperties.get(requiredPropertyName);
				if (property != null) {

					property.setRequired(true);

				} else {

					throw new IllegalStateException("Required property " + requiredPropertyName + " not defined for type " + typeDefinition.getName() + ".");
				}
			}
		}

		if (views != null) {

			for (final Entry<String, Object> entry : views.entrySet()) {

				final String viewName = entry.getKey();
				final Object value    = entry.getValue();

				if (value instanceof List) {

					final Set<String> viewProperties = new TreeSet<>((List)value);
					typeDefinition.getViews().put(viewName, viewProperties);

				} else {

					throw new IllegalStateException("View definition " + viewName + " must be of type array.");
				}
			}
		}

		if (viewOrder != null) {

			typeDefinition.getViewOrder().putAll(viewOrder);
		}

		if (methods != null) {

			for (final Entry<String, Object> entry : methods.entrySet()) {

				final String methodName = entry.getKey();
				final Object value      = entry.getValue();

				if (value instanceof Map) {

					final StructrMethodDefinition method = StructrMethodDefinition.deserialize(typeDefinition, methodName, (Map)value);
					if (method != null) {

						deserializedMethods.put(method.getName(), method);
						typeDefinition.getMethods().add(method);
					}

				} else if (value instanceof Collection) {

					// more than on method with the same name exists..
					final Collection<Map<String, Object>> methodList = (Collection)value;

					for (final Map<String, Object> map : methodList) {

						final StructrMethodDefinition method = StructrMethodDefinition.deserialize(typeDefinition, methodName, map);
						if (method != null) {

							deserializedMethods.put(method.getName(), method);
							typeDefinition.getMethods().add(method);
						}
					}

				} else {

					throw new IllegalStateException("Method definition " + methodName + " must be of type string or map.");
				}
			}
		}

		final Object isAbstractValue = source.get(JsonSchema.KEY_IS_ABSTRACT);
		if (isAbstractValue != null && Boolean.TRUE.equals(isAbstractValue)) {

			typeDefinition.setIsAbstract();
		}

		final Object isInterfaceValue = source.get(JsonSchema.KEY_IS_INTERFACE);
		if (isInterfaceValue != null && Boolean.TRUE.equals(isInterfaceValue)) {

			typeDefinition.setIsInterface();
		}

		final Object isBuiltinType = source.get(JsonSchema.KEY_IS_BUILTIN_TYPE);
		if (isBuiltinType != null && Boolean.TRUE.equals(isBuiltinType)) {

			typeDefinition.setIsBuiltinType();
		}

		final Object categoryValue = source.get(JsonSchema.KEY_CATEGORY);
		if (categoryValue != null) {

			typeDefinition.setCategory(categoryValue.toString());
		}

		return typeDefinition;
	}
966204
@SuppressWarnings("unchecked")
    private void initTypesMapping() {
        if (mapping == null) {
            throw new IllegalStateException("Mapping does contain any information in " +
                    "DeployerTypesResolver " + this);
        }

        if (mapping.containsKey(NODE_TYPES_MAPPING_SECTION)) {
            log.debug("Mapping contains NodeTypes mapping");
            nodeTypesMapping = (Map<String, String>) mapping.get(NODE_TYPES_MAPPING_SECTION);
        }

        if (mapping.containsKey(RELATIONSHIP_TYPES_MAPPING_SECTION)) {
            log.debug("Mapping contains NodeTypes mapping");
            relationshipTypesMapping = (Map<String, String>) mapping
                    .get(RELATIONSHIP_TYPES_MAPPING_SECTION);
        }

        if (mapping.containsKey(NODE_TYPES_DEFINITIONS)) {
            log.debug("Mapping contains NodeTypes description");
            nodeTypesDefinitions = (Map<String, Object>) mapping.get(NODE_TYPES_DEFINITIONS);
        }

        if (mapping.containsKey(POLICY_TYPES_MAPPING_SECTION)) {
            log.debug("Mapping contains Policy mapping");
            policyTypesMapping = (Map<String, String>) mapping.get(POLICY_TYPES_MAPPING_SECTION);
        }
    }
577026
public Csv schema(TypeInformation<Row> schemaType) {
		Preconditions.checkNotNull(schemaType);
		internalProperties.putString(FORMAT_SCHEMA, TypeStringUtils.writeTypeInfo(schemaType));
		return this;
	}
494404
protected void ensurePrefixAndSchemaFitToegether(String prefix, String schema) {
    if (schema == null) {
      return;
    } else if (prefix == null || (prefix != null && !prefix.startsWith(schema + "."))) {
      throw new ProcessEngineException("When setting a schema the prefix has to be schema + '.'. Received schema: " + schema + " prefix: " + prefix);
    }
  }
875351
protected function declareStructure()
    {
        $this->constant('COLLECTION');
        $this->constant('DATABASE');

        parent::declareStructure();

        $this->constant('DEFAULTS')->setValue([]);
        $this->constant('INDEXES')->setValue([]);
    }
579219
public static StructureFiletype guessFiletype(String filename) {
		String lower = filename.toLowerCase();
		for(StructureFiletype type : StructureFiletype.values()) {
			for(String ext : type.getExtensions()) {
				if(lower.endsWith(ext.toLowerCase())) {
					return type;
				}
			}
		}
		return StructureFiletype.UNKNOWN;
	}