Produces the interface declaration.
427324
function class_declaration() {
    $line = '';
    $line .= "interface {$this->component_data['plain_class_name']}";
    if ($this->component_data['parent_interface_names']) {
      $line .= ' extends ';
      $line .= implode(', ', $this->component_data['parent_interface_names']);
    }
    $line .= ' {';

    return [
      $line,
    ];
  }
473024
public final void interfaceDeclaration() throws RecognitionException {
		int interfaceDeclaration_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 16) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:338:5: ( normalInterfaceDeclaration | annotationTypeDeclaration )
			int alt27=2;
			int LA27_0 = input.LA(1);
			if ( (LA27_0==93) ) {
				alt27=1;
			}
			else if ( (LA27_0==58) ) {
				alt27=2;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 27, 0, input);
				throw nvae;
			}

			switch (alt27) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:338:7: normalInterfaceDeclaration
					{
					pushFollow(FOLLOW_normalInterfaceDeclaration_in_interfaceDeclaration543);
					normalInterfaceDeclaration();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:339:11: annotationTypeDeclaration
					{
					pushFollow(FOLLOW_annotationTypeDeclaration_in_interfaceDeclaration555);
					annotationTypeDeclaration();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 16, interfaceDeclaration_StartIndex); }

		}
	}
1325049
private void initTypeParameterBindings()
    {
        //
        // Get an iterator to both the declared type arguments and the original type
        // declaration on the associated control interface
        //
        DeclaredType fieldType = (DeclaredType)_fieldDecl.getType();
        Iterator<TypeMirror> paramBoundIter = fieldType.getActualTypeArguments().iterator();

        TypeDeclaration intfDecl = (TypeDeclaration)_controlIntf.getTypeDeclaration();
        Iterator<TypeParameterDeclaration> paramDeclIter = 
                                            intfDecl.getFormalTypeParameters().iterator();

        //
        // Iterate through them in parallel, creating a mapping from the original formal
        // type parameter name to the actual bound type.  In parallel, also build up a
        // representation of the bound type declaration.
        //
        // NOTE: If no type binding is done on the field declaration, then loop below
        // will not execute and no mappings/empty bound decl will be the result.
        //
        StringBuffer sb = new StringBuffer();
        boolean isFirst = true;
        while (paramBoundIter.hasNext())
        {
            TypeMirror paramBound = paramBoundIter.next();
            TypeParameterDeclaration paramDecl = paramDeclIter.next();

            //
            // Save a mapping from the formal type name to the bound mirror type
            //
            _typeBindingMap.put(paramDecl.getSimpleName(), paramBound);

            if (isFirst)
            {
                sb.append("<");
                isFirst = false;
            }
            else
                sb.append(", ");
            sb.append(paramBound);
        }
        if (!isFirst)
            sb.append(">");
        
        _boundParameterDecl = sb.toString();
    }
76358
def interface_type(self, ift):
        
        if not isinstance(ift, str):
            ift = str(ift)
        self._attributes["if"] = ift
577010
public String getInterfaceClassName()
    {
    	Class<?> interfaceClass = getInterfaceClass();
    	if (interfaceClass != null)
    		return interfaceClass.getName();
		String interfaceClassName = this.getProperty(BundleConstants.INTERFACE);
		if (interfaceClassName == null)
		{
			if (service != null)
				interfaceClassName = service.getClass().getName();	// Default - register under class name
			else
				interfaceClassName = this.getClass().getName();	// Default - register under class name
		}
		return interfaceClassName;
    }
287516
public static IFunctionType getRepresentativeFunctionType( IType interfaceType )
  {
    IMethodInfo javaMethodInfo = getSingleMethod( interfaceType );
    if( javaMethodInfo != null )
    {
      return GosuShop.createFunctionType( javaMethodInfo );
    }
    else
    {
      return null;
    }
  }
322138
def create_interface(self):
        """"""
        return Interface(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
516420
public This getSuper(final Interpreter declaringInterpreter) {
        if (this.parent != null)
            return this.parent.getThis(declaringInterpreter);
        else
            return this.getThis(declaringInterpreter);
    }
460918
function createInterface(params) {
        // Validate params as an object
        if (!isObject(params)) {
            throw new Error('Expected interface definition to be an object with the interface members.');
        }
        // Validate class name
        if (hasOwn(params, '$name')) {
            if (!isString(params.$name)) {
                throw new Error('Interface name must be a string.');
            } else if (/\s+/.test(params.$name)) {
                throw new Error('Interface name cannot have spaces.');
            }
        } else {
            params.$name = 'Unnamed';
        }

        checkKeywords(params);

        var parents,
            current,
            k,
            i,
            value,
            duplicate,
            opts = {},
            name,
            ambiguous,
            unallowed,
            interf = function () {
                throw new Error('Interfaces cannot be instantiated.');
            };

        obfuscateProperty(interf, $interface, { parents: [], methods: {}, staticMethods: {}, constants: {}, check: bind(checkClass, interf) });
        interf.prototype.$name = params.$name;

        if (hasOwn(params, '$extends')) {
            parents = toArray(params.$extends);
            k = parents.length;

            // Verify argument type
            if (!k && !isArray(params.$extends)) {
                throw new Error('$extends of "' + params.$name + '" seems to point to an nonexistent interface.');
            }
            // Verify duplicate entries
            if (k !== unique(parents).length && compact(parents).length === k) {
                throw new Error('There are duplicate entries defined in $extends of "' + params.$name + '".');
            }

            for (k -= 1; k >= 0; k -= 1) {
                current = parents[k];

                // Check if it is a valid interface
                if (!isFunction(current) || !current[$interface]) {
                    throw new Error('Specified interface in $extends at index ' +  k + ' of "' + params.$name + '" is not a valid interface.');
                }

                // Merge methods
                duplicate = intersection(keys(interf[$interface].methods), keys(current[$interface].methods));
                i = duplicate.length;
                if (i) {
                    for (i -= 1; i >= 0; i -= 1) {
                        if (!isFunctionCompatible(interf[$interface].methods[duplicate[i]], current[$interface].methods[duplicate[i]]) &&
                                !isFunctionCompatible(current[$interface].methods[duplicate[i]], interf[$interface].methods[duplicate[i]])) {
                            throw new Error('Interface "' + params.$name + '" is inheriting method "' + duplicate[i] + '" from different parents with incompatible signatures.');
                        }
                    }
                }
                mixIn(interf[$interface].methods, current[$interface].methods);

                // Merge static methods
                duplicate = intersection(keys(interf[$interface].staticMethods), keys(current[$interface].staticMethods));
                i = duplicate.length;
                if (i) {
                    for (i -= 1; i >= 0; i -= 1) {
                        if (!isFunctionCompatible(interf[$interface].staticMethods[duplicate[i]], current[$interface].staticMethods[duplicate[i]]) &&
                                !isFunctionCompatible(current[$interface].staticMethods[duplicate[i]], interf[$interface].staticMethods[duplicate[i]])) {
                            throw new Error('Interface "' + params.$name + '" is inheriting static method "' + duplicate[i] + '" from different parents with incompatible signatures.');
                        }
                    }
                }
                mixIn(interf[$interface].staticMethods, current[$interface].staticMethods);

                // Add interface constants
                for (i in current[$interface].constants) {
                    if (interf[$interface].constants[i]) {
                        if (interf[i] !== current[i]) {
                            throw new Error('Interface "' + params.$name + '" is inheriting constant property "' + i + '" from different parents with different values.');
                        }
                    } else {
                        interf[$interface].constants[i] = current[$interface].constants[i];
                        assignConstant(i, current[i], interf);
                    }
                }

                // Add interface to the parents
                interf[$interface].parents.push(current);
            }

            delete params.$extends;
        }

        // Check if the interface defines the initialize function
        if (hasOwn(params, 'initialize')) {
            throw new Error('Interface "' + params.$name + '" can\'t define the initialize method.');
        }

        // Parse constants
        if (hasOwn(params, '$constants')) {
            // Check argument
            if (!isObject(params.$constants)) {
                throw new Error('$constants definition of interface "' + params.$name + '" must be an object.');
            }

            // Check reserved keywords
            checkKeywords(params.$constants, 'statics');

            // Check unallowed keywords
            unallowed = testKeywords(params.$constants);
            if (unallowed) {
                throw new Error('$constants of interface "' + interf.prototype.$name + '" contains an unallowed keyword: "' + unallowed + '".');
            }

            // Check ambiguity
            if (hasOwn(params, '$statics')) {
                ambiguous = intersection(keys(params.$constants), keys(params.$statics));
                if (ambiguous.length) {
                    throw new Error('There are members defined in interface "' + params.$name + '" with the same name but with different modifiers: "' + ambiguous.join('", ') + '".');
                }
            }

            for (k in params.$constants) {
                addConstant(k, params.$constants[k], interf);
            }

            delete params.$constants;
        }

        // Parse statics
        if (hasOwn(params, '$statics')) {
            // Check argument
            if (!isObject(params.$statics)) {
                throw new Error('$statics definition of interface "' + params.$name + '" must be an object.');
            }

            // Check reserved keywords
            checkKeywords(params.$statics, 'statics');

            // Check unallowed keywords
            unallowed = testKeywords(params.$statics);
            if (unallowed) {
                throw new Error('$statics of interface "' + interf.prototype.$name + '" contains an unallowed keyword: "' + unallowed + '".');
            }

            opts.isStatic = true;

            for (k in params.$statics) {
                value = params.$statics[k];

                // Check if it is not a function
                if (!isFunction(value) || value[$interface] || value[$class]) {
                    throw new Error('Static member "' + k + '" found in interface "' + params.$name + '" is not a function.');
                }

                addMethod(k, value, interf, opts);
            }

            delete opts.isStatic;
            delete params.$statics;
        }

        name = params.$name;
        delete params.$name;

        // Check unallowed keywords
        unallowed = testKeywords(params, ['$extends', '$statics', '$constants']);
        if (unallowed) {
            throw new Error('$statics of interface "' + interf.prototype.$name + '" contains an unallowed keyword: "' + unallowed + '".');
        }

        for (k in params) {
            addMethod(k, params[k], interf);
        }

        params.$name = name;

        // Supply .extend() to easily extend an interface
        interf.extend = extend;

        return interf;
    }
572649
public function generate()
    {
        $code = array();

        if ($this->namespace !== null) {
            $code[] = $this->getIndentation() . 'namespace ' . $this->namespace;
            $code[] = '{';
            $code[] = null;

            // Temporarily add one more level of indentation.
            $this->addIndentationLevel(1);
        }

        $code = array_merge($code, $this->renderUsesLines());

        $indentation = $this->getIndentation();

        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
        }

        $line = $indentation . 'interface ' . $this->name;
        if (count($this->extends) > 0) {
            $line .= ' extends ' . implode(', ', $this->extends);
        }

        $code[] = $line;
        $code[] = $indentation . '{';

        // Interface constants.
        $interfaceElements = $this->generateConstantsLines();

        // Interface methods.
        foreach ($this->methods as $method) {
            if ($method->getVisibility() !== Modifiers::VISIBILITY_PUBLIC) {
                throw new RuntimeException('The visibility of methods must be public.');
            }

            $method->setIndentationString($this->getIndentationString());
            $method->setIndentationLevel($this->getIndentationLevel() + 1);

            $doc = $method->generateDocumentation();
            if ($doc !== null) {
                $interfaceElements[] = $doc;
            }

            $interfaceElements[] = $method->generateSignature() . ';';
            $interfaceElements[] = null;
        }

        if (count($interfaceElements) > 0) {
            $code[] = null;
            $code = array_merge($code, $interfaceElements);
            // Remove last empty line.
            array_pop($code);
        }

        $code[] = $indentation . '}';

        if ($this->namespace !== null) {
            // Set back the indentation.
            $this->addIndentationLevel(-1);

            $code[] = $this->getIndentation() . '}';
        }

        return implode($this->getLineFeed(), $code);
    }
244170
protected void _generate(SarlInterface interf, PyAppendable it, IExtraLanguageGeneratorContext context) {
		generateTypeDeclaration(
				this.qualifiedNameProvider.getFullyQualifiedName(interf).toString(),
				interf.getName(), true, interf.getExtends(),
				getTypeBuilder().getDocumentation(interf),
				true,
				interf.getMembers(), it, context, null);
	}
290721
public final void normalInterfaceDeclaration() throws RecognitionException {
		int normalInterfaceDeclaration_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 17) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:343:5: ( 'interface' Identifier ( typeParameters )? ( 'extends' typeList )? interfaceBody )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:343:7: 'interface' Identifier ( typeParameters )? ( 'extends' typeList )? interfaceBody
			{
			match(input,93,FOLLOW_93_in_normalInterfaceDeclaration572); if (state.failed) return;
			match(input,Identifier,FOLLOW_Identifier_in_normalInterfaceDeclaration574); if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:343:30: ( typeParameters )?
			int alt28=2;
			int LA28_0 = input.LA(1);
			if ( (LA28_0==53) ) {
				alt28=1;
			}
			switch (alt28) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:343:30: typeParameters
					{
					pushFollow(FOLLOW_typeParameters_in_normalInterfaceDeclaration576);
					typeParameters();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:343:46: ( 'extends' typeList )?
			int alt29=2;
			int LA29_0 = input.LA(1);
			if ( (LA29_0==81) ) {
				alt29=1;
			}
			switch (alt29) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:343:47: 'extends' typeList
					{
					match(input,81,FOLLOW_81_in_normalInterfaceDeclaration580); if (state.failed) return;
					pushFollow(FOLLOW_typeList_in_normalInterfaceDeclaration582);
					typeList();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			pushFollow(FOLLOW_interfaceBody_in_normalInterfaceDeclaration586);
			interfaceBody();
			state._fsp--;
			if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 17, normalInterfaceDeclaration_StartIndex); }

		}
	}
465573
public function generateTypeInterface()
    {
        $interface = new PhpInterface($this->typeInterfaceName);
        $interface
            ->setQualifiedName('SecIT\\SchemaOrg\\Mapping\\Type\\'.$this->typeInterfaceName)
            ->setDescription('Interface '.$this->typeInterfaceName.'.')
            ->setMethod(PhpMethod::create('getSchemaUrl')
                ->setDescription('Get schema URL.')
                ->setType('string')
            )
            ->setMethod(PhpMethod::create('getId')
                ->setDescription('Get id.')
                ->setType('string')
            )
        ;

        $generator = new CodeGenerator();
        $code = $generator->generate($interface);

        $directory = $this->getMappingDirectory('Type');
        file_put_contents($directory.$this->typeInterfaceName.'.php', "<?php\n\n".$code);
    }
164315
public void addInterfaceType(DescriptionType descriptionType)
    {
        // Create the interfaces
        InterfaceType interfaceType = wsdlFactory.createInterfaceType();
        descriptionType.getImportOrIncludeOrTypes().add(wsdlFactory.createInterface(interfaceType));
        String interfaceName = this.getControlProperty(MessageControl.INTERFACE_NAME);
        interfaceType.setName(interfaceName);
        
        this.addInterfaceOperationTypes(interfaceType);
    }
1110904
private static String createTypeId(Type type) {
        if (type instanceof Class<?>)
            return Class.class.cast(type).getName();

        if (type instanceof ParameterizedType)
            return createTypeId(((ParameterizedType) type).getRawType())
                + Stream.of(((ParameterizedType) type).getActualTypeArguments())
                .map(CdiSpiHelper::createTypeId)
                .collect(joining(",", "<", ">"));

        if (type instanceof TypeVariable<?>)
            return TypeVariable.class.cast(type).getName();

        if (type instanceof GenericArrayType)
            return createTypeId(GenericArrayType.class.cast(type).getGenericComponentType());

        throw new UnsupportedOperationException("Unable to create type id for type [" + type + "]");
    }
887284
def generate(module):
    
    inter = Interface(PROGRAM_NAME)
    inter.register(module, True)
    return inter
923468
protected void generateIFormalParameterBuilder() {
		final TypeReference builder = getFormalParameterBuilderInterface();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("/** Builder of a " + getLanguageName() //$NON-NLS-1$
						+ " formal parameter."); //$NON-NLS-1$
				it.newLine();
				it.append(" */"); //$NON-NLS-1$
				it.newLine();
				it.append("@SuppressWarnings(\"all\")"); //$NON-NLS-1$
				it.newLine();
				it.append("public interface "); //$NON-NLS-1$
				it.append(builder.getSimpleName());
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append(generateMembers(true, false));
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
			}
		};
		final JavaFileAccess javaFile = getFileAccessFactory().createJavaFile(builder, content);
		javaFile.writeTo(getSrcGen());
	}