Creates a type-safe invoker for calling taglibs.
354022
public <T extends TypedTagLibrary> T createInvoker(Class<T> type) {
        ProxyImpl handler = new ProxyImpl();
        Object proxy = Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, handler);
        handler.setMetaClass(InvokerHelper.getMetaClass(proxy.getClass()));
        return type.cast(proxy);
    }
629501
private LibBinder getTypeLibInfo(IWTypeLib p) throws BindingException {
        LibBinder tli = typeLibs.get(p);
        if(tli==null) {
            typeLibs.put(p,tli=new LibBinder(p));
        }
        return tli;
    }
866249
static Node arrayFromIterable(AbstractCompiler compiler, Node iterable) {
    JSTypeRegistry registry = compiler.getTypeRegistry();
    JSType arrayType = registry.getNativeType(JSTypeNative.ARRAY_TYPE);

    Node call =
        callEs6RuntimeFunction(compiler, iterable, "arrayFromIterable").setJSType(arrayType);
    call.getFirstChild().setJSType(registry.createFunctionTypeWithVarArgs(arrayType));
    return call;
  }
231002
def _generate_union_tag_vars_funcs(self, union):
        """"""
        for field in union.all_fields:
            if not is_void_type(field.data_type):
                enum_field_name = fmt_enum_name(field.name, union)

                with self.block_func(
                        func=fmt_camel(field.name),
                        args=[],
                        return_type=fmt_type(field.data_type)):

                    with self.block(
                            'if (![self is{}])'.format(
                                fmt_camel_upper(field.name)),
                            delim=('{', '}')):
                        error_msg = 'Invalid tag: required {}, but was %@.'.format(
                            enum_field_name)
                        throw_exc = (
                            '[NSException raise:@"IllegalStateException" '
                            'format:@"{}", [self tagName]];')
                        self.emit(throw_exc.format(error_msg))
                    self.emit('return _{};'.format(fmt_var(field.name)))
                self.emit()
359033
public FaceletTaglibTagType<WebFacelettaglibraryDescriptor> getOrCreateTag()
   {
      List<Node> nodeList = model.get("tag");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FaceletTaglibTagTypeImpl<WebFacelettaglibraryDescriptor>(this, "tag", model, nodeList.get(0));
      }
      return createTag();
   }
931082
private void init(InputSource is) throws TagLibException {
	// print.dumpStack();
	try {
	    xmlReader = XMLUtil.createXMLReader();
	    xmlReader.setContentHandler(this);
	    xmlReader.setErrorHandler(this);
	    xmlReader.setEntityResolver(new TagLibEntityResolver());
	    xmlReader.parse(is);
	}
	catch (IOException e) {

	    // String fileName=is.getSystemId();
	    // String message="IOException: ";
	    // if(fileName!=null) message+="In File ["+fileName+"], ";
	    throw new TagLibException(e);
	}
	catch (SAXException e) {
	    // String fileName=is.getSystemId();
	    // String message="SAXException: ";
	    // if(fileName!=null) message+="In File ["+fileName+"], ";
	    throw new TagLibException(e);
	}

    }
1039373
private ImmutableMap<String, String> initCustomTagsMap(ImmutableMap<String, String> tags) {
		return ImmutableMap.copyOf(firstNonNull(tags, Collections.<String, String>emptyMap()));
	}
1056547
def safe_invoke_callback(callback, *args, **kwargs):
    """"""
    # pylint: disable=bare-except
    # We intentionally want to swallow all exceptions.
    try:
        return callback(*args, **kwargs)
    except Exception:
        _LOGGER.exception("Error while executing Future callback.")
989159
public static <T> TypeChecker<List<? extends T>> tList(TypeChecker<? extends T> elementChecker) {
        return new CollectionTypeChecker<>(List.class, elementChecker);
    }
377107
function createPrimaryTypeChecker(type) {

    return createChainableChecker(function (data, dataName, componentName, fullDataName) {

        var dataValue = data[dataName];
        var dataType = getDataType(dataValue);

        if (dataType !== type) {
            throw new Error('[SAN ERROR] '
                + 'Invalid ' + componentName + ' data `' + fullDataName + '` of type'
                + '(' + dataType + ' supplied to ' + componentName + ', '
                + 'expected ' + type + ')'
            );
        }

    });

}
628048
def IsTableProperties(Type, tagname, attrs):
	
	import warnings
	warnings.warn("lsctables.IsTableProperties() is deprecated.  use pycbc_glue.ligolw.table.Table.CheckProperties() instead", DeprecationWarning)
	return Type.CheckProperties(tagname, attrs)
838949
public TagHandler createTagHandler(String ns, String localName, TagConfig tag) throws FacesException
    {
        for (int i = 0; i < this.libraries.length; i++)
        {
            if (this.libraries[i].containsTagHandler(ns, localName))
            {
                return this.libraries[i].createTagHandler(ns, localName, tag);
            }
        }
        return null;
    }
857768
def valid(cls, data, context=None):
        """"""
        return cls(cls.TagType.VALID, data, context)
42582
function(func, thisp) {
		var key = gui.KeyMaster.generateKey();
		this._invokables[key] = function(value, checked) {
			return func.apply(thisp, [gui.Type.cast(value), checked]);
		};
		return key;
	}
1237268
@SuppressWarnings("unchecked") // safe since the proxy implements type
  private <T> T createFakeResource(Class<T> type, final String name) {
    return (T) Proxy.newProxyInstance(
        FakeClientBundleProvider.class.getClassLoader(),
        new Class<?>[] {type},
        new InvocationHandler() {
          @Override
          public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
            Class<?> returnType = method.getReturnType();
            if (returnType == String.class) {
              return name;
            } else if (returnType == SafeHtml.class) {
              return SafeHtmlUtils.fromTrustedString(name);
            } else if (returnType == SafeUri.class) {
              return UriUtils.fromTrustedString(name);
            } else if (returnType == boolean.class) {
              return false;
            } else if (returnType == int.class) {
              return 0;
            } else if (method.getParameterTypes()[0] == ResourceCallback.class) {
              // Read the underlying resource type out of the generic parameter
              // in the method's argument
              Class<?> resourceType = 
                  (Class<?>) 
                  ((ParameterizedType) args[0].getClass().getGenericInterfaces()[0])
                  .getActualTypeArguments()[0];
              ((ResourceCallback<ResourcePrototype>) args[0]).onSuccess(
                  (ResourcePrototype) createFakeResource(resourceType, name));
              return null;
            } else {
              throw new IllegalArgumentException(
                  "Unexpected return type for method " + method.getName());
            }
          }
        });
  }
1092342
@SuppressWarnings("unchecked")
    public <T extends Tag> Set<T> getOfType(final Class<T> type) {
	read.lock();
	try {
	    final Set<T> tagsOfType = (Set<T>) tags.get(type);
	    return tagsOfType != null ? Collections.unmodifiableSet(tagsOfType) : Collections.emptySet();
	} finally {
	    read.unlock();
	}
    }
1147611
protected String generateTaglibInclusions(Collection<String> taglibs) {

        StringBuffer buffer = new StringBuffer();
        for (String taglib : taglibs) {
            String uri = m_taglibs.get(taglib);
            if (uri != null) {
                buffer.append("<%@ taglib prefix=\"" + taglib + "\" uri=\"" + uri + "\" %>");
            }
        }
        return buffer.toString();
    }