Instantiate View subtype from XML stream.

@param name Alternative name to use or {@code null} to keep the one in xml.
343776
public static View createViewFromXML(String name, InputStream xml) throws IOException {

        try (InputStream in = new BufferedInputStream(xml)) {
            View v = (View) Jenkins.XSTREAM.fromXML(in);
            if (name != null) v.name = name;
            Jenkins.checkGoodName(v.name);
            return v;
        } catch(StreamException|ConversionException|Error e) {// mostly reflection errors
            throw new IOException("Unable to read",e);
        }
    }
670194
private static CmsRelationType valueOfInternal(String name) {

        if (name != null) {
            String valueUp = name.toUpperCase();
            for (int i = 0; i < VALUE_ARRAY.length; i++) {
                if (valueUp.equals(VALUE_ARRAY[i].m_name)) {
                    return VALUE_ARRAY[i];
                }
            }
            // deprecated types
            if (valueUp.equals("REFERENCE") || valueUp.equals("XML_REFERENCE")) {
                return XML_WEAK;
            } else if (valueUp.equals("ATTACHMENT") || valueUp.equals("XML_ATTACHMENT")) {
                return XML_STRONG;
            }
            // user defined
            for (int i = 0; i < getAllUserDefined().size(); i++) {
                CmsRelationType type = getAllUserDefined().get(i);
                if (valueUp.equals(type.m_name)) {
                    return type;
                }
            }
        }
        return null;
    }
57915
protected Type<?> loadType( String name )
    {
        Type<?> type = typeLoader.loadType( name );
        if (type == null) throw new TypeNotFoundException( name , this.getClass());
        return type;
    }
246725
public static HtmlTree A_NAME(String name) {
        HtmlTree htmltree = new HtmlTree(HtmlTag.A);
        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
        return htmltree;
    }
501155
public T lookup(String name) throws NamingException {
        T binding = super.get(name);
        if (binding != null) {
            return binding;
        }

        // Binding does not exist.  Check if any the contexts are bindings.
        String contextName = name;
        while (!(contextName = getContextName(contextName)).isEmpty()) {
            if (containsKey(contextName)) {
                throw new NotContextException(namespace + "/" + contextName);
            }
        }

        return null;
    }
566346
public static boolean isJavaBasicType(@Nullable String name) {
        if (StringUtils.isEmpty(name)) {
            return false;
        }
        return isJavaLangType(name) || BASIC_TYPE_MAP.containsKey(name);
    }
1081242
public static XMLStreamException duplicateNamedElement(final XMLExtendedStreamReader reader, final String name) {
        final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.duplicateNamedElement(name, reader.getLocation());

        return new XMLStreamValidationException(ex.getMessage(),
                                                ValidationError.from(ex, ErrorType.DUPLICATE_ELEMENT)
                                                        .element(reader.getName())
                                                        .attribute(QName.valueOf("name"))
                                                        .attributeValue(name),
                                                ex);
    }
284391
public static <T> T newInstance(String name) {
        try {
            return (T) getClass(name).newInstance();
        } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) {
            throw new IllegalStateException(e.getMessage(), e);
        }
    }
924804
@Nullable
  public InputStream getResourceAsStream (final String name)
  {
    InputStream ret = null;
    if (m_aBestCandidate != null)
    {
      ret = m_aBestCandidate.getResourceAsStream (name);
      if (ret != null)
        return ret;
      m_aBestCandidate = null;
    }

    IClassLoadHelper aLoadHelper = null;
    final Iterator <IClassLoadHelper> iter = m_aLoadHelpers.iterator ();
    while (iter.hasNext ())
    {
      aLoadHelper = iter.next ();
      ret = aLoadHelper.getResourceAsStream (name);
      if (ret != null)
        break;
    }

    m_aBestCandidate = aLoadHelper;
    return ret;
  }
213090
public ObjectStreamField getField(String name) {
        ObjectStreamField[] allFields = getFields();
        for (int i = 0; i < allFields.length; i++) {
            ObjectStreamField f = allFields[i];
            if (f.getName().equals(name)) {
                return f;
            }
        }
        return null;
    }
317305
protected Object createNode(Object name, Map attributes) {
        return createNode(name, attributes, null);
    }
765035
private DOMNode getExistingTemplate(final String name) {

		try (final Tx tx = app.tx()) {

			return Importer.findSharedComponentByName(name);

		} catch (FrameworkException fex) {
			logger.warn("Unable to determine if template {} already exists, ignoring.", name);
		}

		return null;
	}
289851
@MemberOrder(sequence = "2")
    public DevUtilsDemoObject create(
            @ParameterLayout(named="Name") final String name) {
        final DevUtilsDemoObject obj = container.newTransientInstance(DevUtilsDemoObject.class);
        obj.setName(name);
        container.persistIfNotAlready(obj);
        return obj;
    }
656138
@Nullable
	public static Type evaluateJavaLangType(@Nonnull final String name) {
		Check.notEmpty(name, "name");
		Type ret = null;
		for (final Type type : JAVA_LANG_VALUE_TYPES) {
			if (type.getName().equals(name.replace("java.lang.", ""))) {
				ret = type;
				break;
			}
		}
		return ret;
	}
1370816
XML makeXmlFromString(XMLName name, String value) {
        try {
            return newTextElementXML(this.node, name.toQname(), value);
        } catch(Exception e) {
            throw ScriptRuntime.typeError(e.getMessage());
        }
    }
104182
public void entityReference(String name) throws org.xml.sax.SAXException
    {
        if (m_elemContext.m_startTagOpen)
        {
            closeStartTag();
            m_elemContext.m_startTagOpen = false;
        }

        try
        {
            if (shouldIndent())
                indent();

            final java.io.Writer writer = m_writer;
            writer.write('&');
            writer.write(name);
            writer.write(';');
        }
        catch(IOException e)
        {
            throw new SAXException(e);
        }
        
        if (m_tracer != null)
            super.fireEntityReference(name);            
    }
956828
public B camundaInputParameter(String name, String value) {
    CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement(CamundaInputOutput.class);

    CamundaInputParameter camundaInputParameter = createChild(camundaInputOutput, CamundaInputParameter.class);
    camundaInputParameter.setCamundaName(name);
    camundaInputParameter.setTextContent(value);

    return myself;
  }