Adds a set of data type specifications.
@param spec - a class that defines data types as member fields
779308
public Reifier addTypeSet(Class<?> spec) {
        for (Field field: spec.getDeclaredFields()) {
            if (Modifier.isPublic(field.getModifiers())) {
                String name = field.getName();
                try {
                    _named.put(name, new Validator(name, field.getType(), field));
                } catch (IllegalArgumentException x) {
                    Trace.g.std.note(Reifier.class, "Ignored " + name + ": " + x.getMessage());
                }
            } else {
                Trace.g.std.note(Reifier.class, "Ignored non-public field: " + field.getName());
            }
        }

        return this;
    }
157667
public static function require_field($table, $field, $spec)
    {
        self::get_schema()->requireField($table, $field, $spec);
    }
464975
public void addExtends(String superType) {
		if (!Strings.isEmpty(superType)
				&& !Capacity.class.getName().equals(superType)) {
			JvmParameterizedTypeReference superTypeRef = newTypeRef(this.sarlCapacity, superType);
			JvmTypeReference baseTypeRef = findType(this.sarlCapacity, Capacity.class.getCanonicalName());
			if (isSubTypeOf(this.sarlCapacity, superTypeRef, baseTypeRef)) {
				this.sarlCapacity.getExtends().add(superTypeRef);
				return;
			}
		}
	}
2843
protected function addFields($source,$spec,&$dest)
    {
        if (isset($spec['fields']))
        {
            foreach ($spec['fields'] as $f)
            {
                if(isset($f['temporary']) && $f['temporary'] === true)
                {
                    if(!in_array($f['fieldName'], $this->temporaryFields))
                    {
                        $this->temporaryFields[] = $f['fieldName'];
                    }
                }
                if(isset($f['predicates']))
                {
                    foreach ($f['predicates'] as $p)
                    {
                        if (is_string($p) && isset($source[$p]))
                        {
                            // Predicate is referenced directly
                            $this->generateValues($source, $f, $p, $dest);
                        } else
                        {
                            // Get a list of functions to run over a predicate - reverse it
                            $predicateFunctions = $this->getPredicateFunctions($p);
                            $predicateFunctions = array_reverse($predicateFunctions);

                            foreach($predicateFunctions as $function => $functionOptions)
                            {
                                // If we've got values then we're the innermost function, so we need to get the values
                                if($function == 'predicates')
                                {
                                    foreach($functionOptions as $v)
                                    {
                                        $v = trim($v);
                                        if (isset($source[$v]))
                                        {
                                            $this->generateValues($source, $f, $v, $dest);
                                        }
                                    }
                                // Otherwise apply a modifier
                                }
                                else
                                {
                                    if(isset($dest[$f['fieldName']]))
                                    {
                                        $dest[$f['fieldName']] = $this->applyModifier($function, $dest[$f['fieldName']], $functionOptions);
                                    }
                                }
                            }
                        }
                    }
                }

                // Allow URI linking to the ID
                if(isset($f['value']))
                {
                    if($f['value'] == '_link_' || $f['value'] == 'link' )
                    {
                        if($f['value'] == '_link_')
                        {
                            $this->warningLog("Table spec value '_link_' is deprecated", $f);
                        }
                        // If value exists, set as array
                        if(isset($dest[$f['fieldName']]))
                        {
                            if(!is_array($dest[$f['fieldName']]))
                            {
                                $dest[$f['fieldName']] = array($dest[$f['fieldName']]);
                            }
                            $dest[$f['fieldName']][] = $this->labeller->qname_to_alias($source['_id']['r']);
                        } else {
                            $dest[$f['fieldName']] = $this->labeller->qname_to_alias($source['_id']['r']);
                        }
                    }
                }
            }
        }
    }
546516
private void addUnitWrappers(TypeSpec.Builder type, NumberData data) {
    MethodSpec.Builder method = MethodSpec.methodBuilder("wrapUnits")
        .addModifiers(PROTECTED)
        .addParameter(PluralCategory.class, "category")
        .addParameter(DigitBuffer.class, "dbuf")
        .addParameter(String.class, "unit")
        .addParameter(StringBuilder.class, "dest");
    
    
    List<String> patterns = new ArrayList<>(new HashSet<>(data.currencyUnitPattern.values()));
    if (patterns.size() == 1) {
      // Short cut if all patterns are the same.
      List<Node> nodes = WRAPPER_PARSER.parseWrapper(patterns.get(0));
      for (Node node : nodes) {
        if (node instanceof Field) {
          Field field = (Field)node;
          if (field.ch() == '0') {
            method.addStatement("dbuf.appendTo(dest)");
          } else {
            method.addStatement("dest.append(unit)");
          }
        } else if (node instanceof Text) {
          method.addStatement("dest.append($S)", ((Text)node).text());
        }
      }
    } else {
      method.beginControlFlow("switch (category)");
      for (Map.Entry<String, String> entry : data.currencyUnitPattern.entrySet()) {
        String[] parts = entry.getKey().split("-");
        PluralCategory category = PluralCategory.fromString(parts[2]);
        String pattern = entry.getValue();
        List<Node> nodes = WRAPPER_PARSER.parseWrapper(pattern);
        if (category != PluralCategory.OTHER) {
          method.beginControlFlow("case $L:", category);
        } else {
          method.beginControlFlow("case $L:\ndefault:", category);
        }
        for (Node node : nodes) {
          if (node instanceof Field) {
            Field field = (Field)node;
            if (field.ch() == '0') {
              method.addStatement("dbuf.appendTo(dest)");
            } else {
              method.addStatement("dest.append(unit)");
            }
          } else if (node instanceof Text) {
            method.addStatement("dest.append($S)", ((Text)node).text());
          }
        }
        method.addStatement("break");
        method.endControlFlow();
      }
      method.endControlFlow();
    }
    
    type.addMethod(method.build());
  }
562416
public function addUnit(SpecificationUnit $specUnit, $or_union_name = null)
    {
        if($or_union_name === null)
        {
            $this->free[] = $specUnit;
        }
        else
        {
            $this->check_or_union($or_union_name);

            $this->or_union[$or_union_name][] =  $specUnit;
        }

        $this->fields_paths[] = $specUnit->getFieldName();
    }
1052448
private Set<Class<?>> collectModules(SpecInfo spec) {
    Set<Class<?>> modules = null;

    for (SpecInfo curr : spec.getSpecsTopToBottom()) {
      if (importModuleAnnotation != null && spec.isAnnotationPresent(importModuleAnnotation)){
        org.apache.tapestry5.ioc.annotations.ImportModule importModule = curr
            .getAnnotation(org.apache.tapestry5.ioc.annotations.ImportModule.class);
        if (importModule != null) {
          if (modules == null) {
            modules = new HashSet<>();
          }
          modules.addAll(Arrays.<Class<?>> asList(importModule.value()));
        }
      }
      if (submoduleAnnotation != null && spec.isAnnotationPresent(submoduleAnnotation)){
        @SuppressWarnings("deprecation")
        SubModule subModule = curr.getAnnotation(SubModule.class);
        if (subModule != null) {
          if (modules == null) {
            modules = new HashSet<>();
          }
          modules.addAll(Arrays.<Class<?>> asList(subModule.value()));
        }
      }
    }

    return modules;
  }
662460
private void addDerivedTypes() {
		Iterator<DefinedType> typeIter = schema.getTypes().iterator();
		while (typeIter.hasNext()) {
			DefinedType type = typeIter.next();
			// debug (type.getName()+":"+type.getDomain(true).toString());
			// if ((type.getDomain() instanceof SimpleType)==false &&
			// (type instanceof EnumerationType)==false &&
			// (type instanceof SelectType)==false){

			/*
			 * one of the hard things TODO : TYPE IfcCompoundPlaneAngleMeasure =
			 * LIST [3:3] OF INTEGER; WHERE WR1 : { -360 <= SELF[1] < 360 }; WR2
			 * : { -60 <= SELF[2] < 60 }; WR3 : { -60 <= SELF[3] < 60 }; WR4 :
			 * ((SELF[1] >= 0) AND (SELF[2] >= 0) AND (SELF[3] >= 0)) OR
			 * ((SELF[1] <= 0) AND (SELF[2] <= 0) AND (SELF[3] <= 0)); END_TYPE;
			 * 
			 * I am skipping this for now, it only occurs once in the model
			 * future versions should definitely find an answer to this
			 * 
			 * A fix for this has been implemented in addHackedTypes
			 */
			if (type.getName().equalsIgnoreCase("IfcCompoundPlaneAngleMeasure")) {
				EClass testType = getOrCreateEClass(type.getName());
				DefinedType type2 = new DefinedType("Integer");
				type2.setDomain(new IntegerType());
				modifySimpleType(type2, testType);
				testType.getEAnnotations().add(createWrappedAnnotation());
			} else if (type.getDomain() instanceof DefinedType) {
				if (schemaPack.getEClassifier(type.getName()) != null) {
					EClass testType = (EClass) schemaPack.getEClassifier(type.getName());
					DefinedType domain = (DefinedType) type.getDomain();
					EClassifier classifier = schemaPack.getEClassifier(domain.getName());
					testType.getESuperTypes().add((EClass) classifier);
					testType.setInstanceClass(classifier.getInstanceClass());
				} else {
					EClass testType = getOrCreateEClass(type.getName());
					DefinedType domain = (DefinedType) type.getDomain();
					if (simpleTypeReplacementMap.containsKey(domain.getName())) {
						// We can't subclass because it's a 'primitive' type
						simpleTypeReplacementMap.put(type.getName(), simpleTypeReplacementMap.get(domain.getName()));
					} else {
						EClass classifier = getOrCreateEClass(domain.getName());
						testType.getESuperTypes().add((EClass) classifier);
						if (classifier.getEAnnotation("wrapped") != null) {
							testType.getEAnnotations().add(createWrappedAnnotation());
						}
						testType.setInstanceClass(classifier.getInstanceClass());
					}
				}
			}
		}
	}
834677
function (spec_str) {

	// Specification string
	this.specStr = spec_str;

	// Variable type
	this.VARIABLE_TYPES = ['BOOLEAN', 'FLOAT', 'INTEGER', 'NUMBER', 'STRING', 'TEXT'];
	this.type = null;

	// Range of value
	this.min = null;
	this.max = null;

	// Additonal options
	this.OPTION_KEYS = ['DEFAULT', 'REGEXP'];

	// Additonal options - Default value
	this.default = null;

	// Additonal options - Regular Expression for STRING or TEXT
	this.regExp = null;

	// ---

	// Parse the specification string
	this._parseSpec(this.specStr);

}
217620
public void add(VerifierComponent descr) {

        if ( subSolver != null ) {
            subSolver.add( descr );
        } else {
            if ( type == OperatorDescrType.AND ) {
                if ( possibilityLists.isEmpty() ) {
                    possibilityLists.add( new HashSet<VerifierComponent>() );
                }
                for ( Set<VerifierComponent> set : possibilityLists ) {
                    set.add( descr );
                }
            } else if ( type == OperatorDescrType.OR ) {
                Set<VerifierComponent> set = new HashSet<VerifierComponent>();
                set.add( descr );
                possibilityLists.add( set );
            }
        }
    }
240582
def extend_schema_spec(self) -> None:
        
        super().extend_schema_spec()

        if self.ATTRIBUTE_FIELDS in self._spec:
            # Add new fields to the schema spec. Since `_identity` is added by the super, new elements are added after
            predefined_field = self._build_time_fields_spec(self._spec[self.ATTRIBUTE_NAME])
            self._spec[self.ATTRIBUTE_FIELDS][1:1] = predefined_field

            # Add new field schema to the schema loader
            for field_schema in predefined_field:
                self.schema_loader.add_schema_spec(field_schema, self.fully_qualified_name)
1267811
private void addTypedPattern(MethodSpec.Builder method, String formatType, String pattern) {
    method.beginControlFlow("case $L:", formatType);
    method.addComment("$S", pattern);
    addPattern(method, pattern);
    method.addStatement("break");
    method.endControlFlow();
  }
861345
private void addDefines(final String[] defs, final boolean isDefine) {
    for (final String def2 : defs) {
      UndefineArgument def;
      if (isDefine) {
        def = new DefineArgument();
      } else {
        def = new UndefineArgument();
      }
      def.setName(def2);
      this.defineList.addElement(def);
    }
  }
932712
public void addAll(Schema sch) {
		fields.putAll(sch.fields);
		if (myFieldSet != null)
			myFieldSet = new TreeSet<String>(fields.keySet());
	}
882422
public static void setAdditionalFields(String spec, GelfMessageAssembler gelfMessageAssembler) {
        if (null != spec) {
            String[] properties = spec.split(MULTI_VALUE_DELIMITTER);

            for (String field : properties) {
                final int index = field.indexOf(EQ);
                if (-1 == index) {
                    continue;
                }
                gelfMessageAssembler.addField(new StaticMessageField(field.substring(0, index), field.substring(index + 1)));
            }
        }
    }
158359
def _create_mappings(self, spec):
        
        ret = dict(zip(set(spec.fields), set(spec.fields)))
        ret.update(dict([(n, s.alias) for n, s in spec.fields.items() if s.alias]))
        return ret
1275907
private void addClassProperties() {

    List<VariableElement> fields = processingContext.allFields(element);

    for (VariableElement field : fields) {
      PropertyType type = processingContext.getPropertyType(field);
      if (type != null) {
        type.addImports(importTypes);
        properties.add(new PropertyMeta(field.getSimpleName().toString(), type));
      }
    }
  }