Java Code Examples for com.sun.istack.internal.Nullable

The following are top voted examples for showing how to use com.sun.istack.internal.Nullable. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openjdk-jdk10   File: AbstractSchemaValidationTube.java   Source Code and License 8 votes vote down vote up
private @Nullable void addSchemaFragmentSource(Document doc, String systemId, Map<String, DOMSource> map) {
    Element e = doc.getDocumentElement();
    assert e.getNamespaceURI().equals(WSDLConstants.NS_WSDL);
    assert e.getLocalName().equals("definitions");

    NodeList typesList = e.getElementsByTagNameNS(WSDLConstants.NS_WSDL, "types");
    for(int i=0; i < typesList.getLength(); i++) {
        NodeList schemaList = ((Element)typesList.item(i)).getElementsByTagNameNS(WSDLConstants.NS_XMLNS, "schema");
        for(int j=0; j < schemaList.getLength(); j++) {
            Element elem = (Element)schemaList.item(j);
            NamespaceSupport nss = new NamespaceSupport();
            // Doing this because transformer is not picking up inscope namespaces
            // why doesn't transformer pickup the inscope namespaces ??
            buildNamespaceSupport(nss, elem);
            patchDOMFragment(nss, elem);
            String docId = systemId+"#schema"+j;
            map.put(docId, new DOMSource(elem, docId));
        }
    }
}
 
Example 2
Project: OpenJSharp   File: SOAPFaultBuilder.java   Source Code and License 6 votes vote down vote up
/**
 * Creates a DOM node that represents the complete stack trace of the exception,
 * and attach that to {@link DetailType}.
 */
final void captureStackTrace(@Nullable Throwable t) {
    if(t==null)     return;
    if(!captureStackTrace)  return;     // feature disabled

    try {
        Document d = DOMUtil.createDom();
        ExceptionBean.marshal(t,d);

        DetailType detail = getDetail();
        if(detail==null)
        setDetail(detail=new DetailType());

        detail.getDetails().add(d.getDocumentElement());
    } catch (JAXBException e) {
        // this should never happen
        logger.log(Level.WARNING, "Unable to capture the stack trace into XML",e);
    }
}
 
Example 3
Project: OpenJSharp   File: BaseDistributedPropertySet.java   Source Code and License 6 votes vote down vote up
@Override
public @Nullable <T extends com.oracle.webservices.internal.api.message.PropertySet> T getSatellite(Class<T> satelliteClass) {
    T satellite = (T) satellites.get(satelliteClass);
    if (satellite != null) {
        return satellite;
    }

    for (PropertySet child : satellites.values()) {
        if (satelliteClass.isInstance(child)) {
            return satelliteClass.cast(child);
        }

        if (DistributedPropertySet.class.isInstance(child)) {
            satellite = DistributedPropertySet.class.cast(child).getSatellite(satelliteClass);
            if (satellite != null) {
                return satellite;
            }
        }
    }
    return null;
}
 
Example 4
Project: MicroServiceDemo   File: RestTemplate.java   Source Code and License 6 votes vote down vote up
@Override
@Nullable
protected <T> T doExecute(URI url, @Nullable HttpMethod method, @Nullable RequestCallback requestCallback,
                          @Nullable ResponseExtractor<T> responseExtractor) throws RestClientException {
    String from = name;
    String to = url.
            toString().
            replace("http://", "").
            replace("http:// www.", "").
            replace("www.", "").
            replace("/", "%20").
            toLowerCase();

    System.out.println(from);
    System.out.println(to);

    try {
        restTemplate.postForObject("http://trace-callback-service/" + from + "/" + to, null, Object.class);
    } catch (Exception exception) {
    }

    return super.doExecute(url, method, requestCallback, responseExtractor);
}
 
Example 5
Project: openjdk-jdk10   File: ProviderInvokerTubeFactory.java   Source Code and License 6 votes vote down vote up
/**
 * @param classLoader
 * @param container
 * @param implType
 * @param invoker
 * @param argsBuilder
 * @param isAsync
 *
 * @return
 */
public static <T> ProviderInvokerTube<T> create(@Nullable final ClassLoader classLoader,
                                                @NotNull  final Container container,
                                                @NotNull  final Class<T> implType,
                                                @NotNull  final Invoker invoker,
                                                @NotNull  final ProviderArgumentsBuilder<?> argsBuilder,
                                                          final boolean isAsync)
{
    for (ProviderInvokerTubeFactory factory : ServiceFinder.find(ProviderInvokerTubeFactory.class,
                                                                 classLoader, container))
    {
        ProviderInvokerTube<T> tube = factory.doCreate(implType, invoker, argsBuilder, isAsync);
        if (tube != null) {
            if (logger.isLoggable(Level.FINE)) {
                ProviderInvokerTubeFactory.logger.log(Level.FINE, "{0} successfully created {1}", new Object[]{factory.getClass(), tube});
            }
            return tube;
        }
    }
    return DEFAULT.createDefault(implType, invoker, argsBuilder, isAsync);
}
 
Example 6
Project: OpenJSharp   File: WSServiceDelegate.java   Source Code and License 6 votes vote down vote up
private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr, QName portName, Class<T> portInterface,
                                        WebServiceFeatureList webServiceFeatures, SEIPortInfo eif) {
    //fail if service doesnt have WSDL
    if (wsdlService == null) {
        throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));
    }

    if (wsdlService.get(portName)==null) {
        throw new WebServiceException(
            ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
    }

    BindingImpl binding = eif.createBinding(webServiceFeatures, portInterface);
    InvocationHandler pis = getStubHandler(binding, eif, epr);

    T proxy = createProxy(portInterface, pis);

    if (serviceInterceptor != null) {
        serviceInterceptor.postCreateProxy((WSBindingProvider)proxy, portInterface);
    }
    return proxy;
}
 
Example 7
Project: openjdk-jdk10   File: BaseDistributedPropertySet.java   Source Code and License 6 votes vote down vote up
@Override
public @Nullable <T extends com.oracle.webservices.internal.api.message.PropertySet> T getSatellite(Class<T> satelliteClass) {
    T satellite = (T) satellites.get(satelliteClass);
    if (satellite != null) {
        return satellite;
    }

    for (PropertySet child : satellites.values()) {
        if (satelliteClass.isInstance(child)) {
            return satelliteClass.cast(child);
        }

        if (DistributedPropertySet.class.isInstance(child)) {
            satellite = DistributedPropertySet.class.cast(child).getSatellite(satelliteClass);
            if (satellite != null) {
                return satellite;
            }
        }
    }
    return null;
}
 
Example 8
Project: OpenJSharp   File: Packet.java   Source Code and License 6 votes vote down vote up
/**
 * Creates a server-side response {@link Packet} from a request
 * packet ({@code this}). If WS-Addressing is enabled, <code>action</code>
 * is used as Action Message Addressing Property.
 * <p><p>
 * This method should be called only for creating protocol response messages
 * that require a particular value of Action since they are not associated
 * with a {@link WSBinding} and {@link WSDLPort} but do know the {@link AddressingVersion}
 * and {@link SOAPVersion}.
 *
 * @param responseMessage The {@link Message} that represents a reply. Can be null.
 * @param addressingVersion The WS-Addressing version of the response message.
 * @param soapVersion The SOAP version of the response message.
 * @param action The response Action Message Addressing Property value.
 * @return response packet
 */
public Packet createServerResponse(@Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull String action) {
    Packet responsePacket = createClientResponse(responseMessage);
    responsePacket.setState(State.ServerResponse);
    // populate WS-A headers only if WS-A is enabled
    if (addressingVersion == null) {
        return responsePacket;
    }
    //populate WS-A headers only if the request has addressing headers
    String inputAction = AddressingUtils.getAction(this.getMessage().getHeaders(), addressingVersion, soapVersion);
    if (inputAction == null) {
        return responsePacket;
    }

    populateAddressingHeaders(responsePacket, addressingVersion, soapVersion, action, false);
    return responsePacket;
}
 
Example 9
Project: OpenJSharp   File: FeatureListUtil.java   Source Code and License 6 votes vote down vote up
public static @Nullable <F extends WebServiceFeature> F mergeFeature(final @NotNull Class<F> featureType,
        @Nullable WebServiceFeatureList list1, @Nullable WebServiceFeatureList list2)
        throws WebServiceException {
    final F feature1 = list1 != null ? list1.get(featureType) : null;
    final F feature2 = list2 != null ? list2.get(featureType) : null;
    if (feature1 == null) {
        return feature2;
    }
    else if (feature2 == null) {
        return feature1;
    }
    else {
        if (feature1.equals(feature2)) {
            return feature1;
        }
        else {
            // TODO exception text
            throw new WebServiceException(feature1 + ", " + feature2);
        }
    }
}
 
Example 10
Project: openjdk-jdk10   File: OperationDispatcher.java   Source Code and License 5 votes vote down vote up
public OperationDispatcher(@NotNull WSDLPort wsdlModel, @NotNull WSBinding binding, @Nullable SEIModel seiModel) {
    this.binding = binding;
    opFinders = new ArrayList<WSDLOperationFinder>();
    if (binding.getAddressingVersion() != null) {
        opFinders.add(new ActionBasedOperationFinder(wsdlModel, binding, seiModel));
    }
    opFinders.add(new PayloadQNameBasedOperationFinder(wsdlModel, binding, seiModel));
    opFinders.add(new SOAPActionBasedOperationFinder(wsdlModel, binding, seiModel));

}
 
Example 11
Project: openjdk-jdk10   File: WsaTubeHelper.java   Source Code and License 5 votes vote down vote up
String getOutputAction(@Nullable WSDLBoundOperation wbo) {
    String action = AddressingVersion.UNSET_OUTPUT_ACTION;
    if (wbo != null) {
        WSDLOutput op = wbo.getOperation().getOutput();
        if (op != null) {
            action = op.getAction();
        }
    }
    return action;
}
 
Example 12
Project: openjdk-jdk10   File: ClientTubeAssemblerContext.java   Source Code and License 5 votes vote down vote up
/**
 * This constructor should be used only by JAX-WS Runtime and is not meant for external consumption.
 *
 * @since JAX-WS 2.2
 */
public ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel,
                                  @NotNull WSBindingProvider bindingProvider, @NotNull WSBinding binding,
                                  @NotNull Container container, Codec codec, SEIModel seiModel, Class sei) {
    this(address, wsdlModel, (bindingProvider==null? null: bindingProvider.getPortInfo().getOwner()), bindingProvider, binding, container, codec, seiModel, sei);

}
 
Example 13
Project: SuprDiscordBot   File: ScriptManager.java   Source Code and License 5 votes vote down vote up
@Nullable
FailedScript getFailedScript(@NotNull final String name)
{
	for(FailedScript script : failedscripts)
	{
		if(script.name.equals(name))
		{
			return script;
		}
	}
	return null;
}
 
Example 14
Project: SuprDiscordBot   File: ScriptManager.java   Source Code and License 5 votes vote down vote up
@Nullable
void removeScript(@NotNull final Script script)
{
	if(scripts.contains(script))
	{
		scripts.remove(script);
	}
}
 
Example 15
Project: OpenJSharp   File: DOMUtil.java   Source Code and License 5 votes vote down vote up
/**
 * Gets the first element child.
 */
public static
@Nullable
Element getFirstElementChild(Node parent) {
    for (Node n = parent.getFirstChild(); n != null; n = n.getNextSibling()) {
        if (n.getNodeType() == Node.ELEMENT_NODE) {
            return (Element) n;
        }
    }
    return null;
}
 
Example 16
Project: openjdk-jdk10   File: HttpClientTransport.java   Source Code and License 5 votes vote down vote up
protected @Nullable InputStream readResponse() {
    InputStream is;
    try {
        is = httpConnection.getInputStream();
    } catch(IOException ioe) {
        is = httpConnection.getErrorStream();
    }
    if (is == null) {
        return is;
    }
    // Since StreamMessage doesn't read </s:Body></s:Envelope>, there
    // are some bytes left in the InputStream. This confuses JDK and may
    // not reuse underlying sockets. Hopefully JDK fixes it in its code !
    final InputStream temp = is;
    return new FilterInputStream(temp) {
        // Workaround for "SJSXP XMLStreamReader.next() closes stream".
        // So it doesn't read from the closed stream
        boolean closed;
        @Override
        public void close() throws IOException {
            if (!closed) {
                closed = true;
                while(temp.read(THROW_AWAY_BUFFER) != -1);
                super.close();
            }
        }
    };
}
 
Example 17
Project: green-cat   File: ModulesResolveTask.java   Source Code and License 5 votes vote down vote up
@Nullable
private Module getModuleInfo(String moduleFilePath) throws ModuleFileParsingException {
    String moduleName = new File(moduleFilePath).getName().split("\\.")[0];
    String cmd = CommandLineBuilder.create("cat")
            .add(new Parameter(moduleFilePath))
            .add(new Parameter("| grep 'output url='"))
            .build();
    List<String> output = CommandExecutor.execOnInputStream(cmd);

    if (output.size() == 0) {
        return null;

    } else if (output.size() > 1) {
        throw new ModuleFileParsingException("Multiple XML entities <output url= ... /> found");

    } else {
        int pathLength = moduleFilePath.lastIndexOf('/');
        String modulePath = moduleFilePath.substring(0, pathLength);

        int variantStartIndex = output.get(0).lastIndexOf("/classes/") + 9;
        int variantEndIndex = output.get(0).lastIndexOf("\"");
        String moduleVariant = output.get(0).substring(variantStartIndex, variantEndIndex);

        String buildPath = modulePath + "/build/intermediates/classes/" + moduleVariant;

        if (!Utils.fileExists(buildPath)) {
            buildPath = modulePath + "/build/classes/" + moduleVariant;
        }

        if (!Utils.fileExists(buildPath)) {
            buildPath = null;
        }

        return new Module(moduleName, modulePath, buildPath, moduleVariant);
    }
}
 
Example 18
Project: green-cat   File: TaskExecutor.java   Source Code and License 5 votes vote down vote up
public Result(Task task, Message message, @Nullable String description, ExecutionStatus status, long nanoTime) {
    this.task = task;
    this.description = description;
    this.message = message;
    this.status = status;
    this.nanoTime = nanoTime;
}
 
Example 19
Project: openjdk-jdk10   File: ClientTubeAssemblerContext.java   Source Code and License 5 votes vote down vote up
private ClientTubeAssemblerContext(@NotNull EndpointAddress address, @Nullable WSDLPort wsdlModel,
                                   @Nullable WSService rootOwner, @Nullable WSBindingProvider bindingProvider, @NotNull WSBinding binding,
                                  @NotNull Container container, Codec codec, SEIModel seiModel, Class sei) {
    this.address = address;
    this.wsdlModel = wsdlModel;
    this.rootOwner = rootOwner;
    this.bindingProvider = bindingProvider;
    this.binding = binding;
    this.container = container;
    this.codec = codec;
    this.seiModel = seiModel;
    this.sei = sei;
}
 
Example 20
Project: OpenJSharp   File: RuntimeWSDLParser.java   Source Code and License 5 votes vote down vote up
/**
 * Parses the WSDL and gives WSDLModel. If wsdl parameter is null, then wsdlLoc is used to get the WSDL. If the WSDL
 * document could not be obtained then {@link MetadataResolverFactory} is tried to get the WSDL document, if not found
 * then as last option, if the wsdlLoc has no '?wsdl' as query parameter then it is tried by appending '?wsdl'.
 *
 * @param wsdlLoc
 *      Either this or <tt>wsdl</tt> parameter must be given.
 *      Null location means the system won't be able to resolve relative references in the WSDL,
 */
public static WSDLModel parse(@Nullable URL wsdlLoc, @NotNull Source wsdlSource, @NotNull EntityResolver resolver,
                                  boolean isClientSide, Container container, Class serviceClass,
                                  @NotNull PolicyResolver policyResolver,
                                  boolean isUseStreamFromEntityResolverWrapper,
                                  WSDLParserExtension... extensions) throws IOException, XMLStreamException, SAXException {
    assert resolver != null;

    RuntimeWSDLParser wsdlParser = new RuntimeWSDLParser(wsdlSource.getSystemId(), new EntityResolverWrapper(resolver, isUseStreamFromEntityResolverWrapper), isClientSide, container, policyResolver, extensions);
    Parser parser;
    try{
        parser = wsdlParser.resolveWSDL(wsdlLoc, wsdlSource, serviceClass);
        if(!hasWSDLDefinitions(parser.parser)){
            throw new XMLStreamException(ClientMessages.RUNTIME_WSDLPARSER_INVALID_WSDL(parser.systemId,
                    WSDLConstants.QNAME_DEFINITIONS, parser.parser.getName(), parser.parser.getLocation()));
        }
    }catch(XMLStreamException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);

    }catch(IOException e){
        //Try MEX if there is WSDLLoc available
        if(wsdlLoc == null)
            throw e;
        return tryWithMex(wsdlParser, wsdlLoc, resolver, isClientSide, container, e, serviceClass, policyResolver, extensions);
    }
    wsdlParser.extensionFacade.start(wsdlParser.context);
    wsdlParser.parseWSDL(parser, false);
    wsdlParser.wsdlDoc.freeze();
    wsdlParser.extensionFacade.finished(wsdlParser.context);
    wsdlParser.extensionFacade.postFinished(wsdlParser.context);

    if(wsdlParser.wsdlDoc.getServices().isEmpty())
        throw new WebServiceException(ClientMessages.WSDL_CONTAINS_NO_SERVICE(wsdlLoc));

    return wsdlParser.wsdlDoc;
}
 
Example 21
Project: OpenJSharp   File: StreamMessage.java   Source Code and License 5 votes vote down vote up
private void init(@NotNull TagInfoset envelopeTag, @Nullable TagInfoset headerTag, @NotNull AttachmentSet attachmentSet, @Nullable MessageHeaders headers, @Nullable String bodyPrologue, @NotNull TagInfoset bodyTag, @Nullable String bodyEpilogue, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) {
    init(headers,attachmentSet,reader,soapVersion);
    if(envelopeTag == null ) {
        throw new IllegalArgumentException("EnvelopeTag TagInfoset cannot be null");
    }
    if(bodyTag == null ) {
        throw new IllegalArgumentException("BodyTag TagInfoset cannot be null");
    }
    this.envelopeTag = envelopeTag;
    this.headerTag = headerTag;
    this.bodyTag = bodyTag;
    this.bodyPrologue = bodyPrologue;
    this.bodyEpilogue = bodyEpilogue;
}
 
Example 22
Project: openjdk-jdk10   File: BGMBuilder.java   Source Code and License 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 23
Project: OpenJSharp   File: Message.java   Source Code and License 5 votes vote down vote up
/**
 * It gives S:Envelope/S:Body/S:Fault/detail 's first child's name. Should
 * be called for messages that have SOAP Fault.
 *
 * <p> This implementation is expensive so concrete implementations are
 * expected to override this one.
 *
 * @return first detail entry's name, if there is one
 *         else null
 */
public @Nullable QName getFirstDetailEntryName() {
    assert isFault();
    Message msg = copy();
    try {
        SOAPFaultBuilder fault = SOAPFaultBuilder.create(msg);
        return fault.getFirstDetailEntryName();
    } catch (JAXBException e) {
        throw new WebServiceException(e);
    }
}
 
Example 24
Project: OpenJSharp   File: DetailType.java   Source Code and License 5 votes vote down vote up
/**
 * Gets the n-th detail object, or null if no such item exists.
 */
@Nullable
Node getDetail(int n) {
    if(n < detailEntry.size())
        return detailEntry.get(n);
    else
        return null;
}
 
Example 25
Project: Java-RPG-Maker-MV-Decrypter   File: JLabelExtra.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the Text-Color of the JLabelExtra
 *
 * @param color - new Color for the Text or null for default
 */
public void setTextColor(@Nullable Color color) {
	if(color == null) {
		this.setForeground(new JLabel().getForeground());
		return;
	}

	this.setForeground(color);
}
 
Example 26
Project: OpenJSharp   File: HeaderList.java   Source Code and License 5 votes vote down vote up
/**
 * Gets the first {@link Header} of the specified name.
 *
 * @param markAsUnderstood
 *      If this parameter is true, the returned header will
 *      be marked as <a href="#MU">"understood"</a>.
 * @return null if not found.
 */
@Override
public @Nullable Header get(@NotNull String nsUri, @NotNull String localName, boolean markAsUnderstood) {
    int len = size();
    for (int i = 0; i < len; i++) {
        Header h = get(i);
        if (h.getLocalPart().equals(localName) && h.getNamespaceURI().equals(nsUri)) {
            if (markAsUnderstood) {
                understood(i);
            }
            return h;
        }
    }
    return null;
}
 
Example 27
Project: openjdk-jdk10   File: SOAPFaultBuilder.java   Source Code and License 5 votes vote down vote up
private static @Nullable QName getFirstDetailEntryName(@Nullable Detail detail) {
    if (detail != null) {
        Iterator<DetailEntry> it = detail.getDetailEntries();
        if (it.hasNext()) {
            DetailEntry entry = it.next();
            return getFirstDetailEntryName(entry);
        }
    }
    return null;
}
 
Example 28
Project: OpenJSharp   File: WSEndpointReference.java   Source Code and License 5 votes vote down vote up
/**
 * Creates an EPR from individual components.
 *
 * <p>
 * This version takes various information about metadata, and creates an EPR that has
 * the necessary embedded WSDL.
 */
public WSEndpointReference(@NotNull AddressingVersion version,
                           @NotNull String address,
                           @Nullable QName service,
                           @Nullable QName port,
                           @Nullable QName portType,
                           @Nullable List<Element> metadata,
                           @Nullable String wsdlAddress,
                           @Nullable List<Element> referenceParameters) {
   this(version, address, service, port, portType, metadata, wsdlAddress, null, referenceParameters, null, null);
}
 
Example 29
Project: OpenJSharp   File: WSEndpointReference.java   Source Code and License 5 votes vote down vote up
/**
 * Creates an EPR from individual components.
 *
 * <p>
 * This version takes various information about metadata, and creates an EPR that has
 * the necessary embedded WSDL.
 */
public WSEndpointReference(@NotNull AddressingVersion version,
                           @NotNull String address,
                           @Nullable QName service,
                           @Nullable QName port,
                           @Nullable QName portType,
                           @Nullable List<Element> metadata,
                           @Nullable String wsdlAddress,
                           @Nullable List<Element> referenceParameters,
                           @Nullable Collection<EPRExtension> extns,@Nullable Map<QName, String> attributes) {
   this(createBufferFromData(version, address, referenceParameters, service, port, portType, metadata, wsdlAddress, null, extns, attributes),
        version );
}
 
Example 30
Project: openjdk-jdk10   File: PayloadSourceMessage.java   Source Code and License 5 votes vote down vote up
public PayloadSourceMessage(@Nullable MessageHeaders headers,
    @NotNull Source payload, @NotNull AttachmentSet attSet,
    @NotNull SOAPVersion soapVersion) {

    super(headers, SourceReaderFactory.createSourceReader(payload, true),
            attSet, soapVersion);
}
 
Example 31
Project: openjdk-jdk10   File: WSEndpointReference.java   Source Code and License 5 votes vote down vote up
/**
 * Creates an EPR from individual components.
 *
 * <p>
 * This version takes various information about metadata, and creates an EPR that has
 * the necessary embedded WSDL.
 * @since JAX-WS 2.2
 */
public WSEndpointReference(@NotNull AddressingVersion version,
                           @NotNull String address,
                           @Nullable QName service,
                           @Nullable QName port,
                           @Nullable QName portType,
                           @Nullable List<Element> metadata,
                           @Nullable String wsdlAddress,
                           @Nullable String wsdlTargetNamepsace,
                           @Nullable List<Element> referenceParameters,
                           @Nullable List<Element> elements, @Nullable Map<QName, String> attributes) {
   this(
        createBufferFromData(version, address, referenceParameters, service, port, portType, metadata, wsdlAddress,wsdlTargetNamepsace, elements, attributes),
        version );
}
 
Example 32
Project: openjdk-jdk10   File: DOMUtil.java   Source Code and License 5 votes vote down vote up
/**
 * Gets the first element child.
 */
public static
@Nullable
Element getFirstElementChild(Node parent) {
    for (Node n = parent.getFirstChild(); n != null; n = n.getNextSibling()) {
        if (n.getNodeType() == Node.ELEMENT_NODE) {
            return (Element) n;
        }
    }
    return null;
}
 
Example 33
Project: DiscordWebhooks   File: Embed.java   Source Code and License 4 votes vote down vote up
/**
 * Sets the {@link #title} for the {@link Embed}, as well as the
 * {@link #url} for the title's masked link.
 *
 * <p>While the title content must be set, the URL is optional
 * and setting {@code null} for the url will result in no masked
 * link being provided.
 *
 * <p>Providing {@code null} for the content will remove the title
 * component from the Embed entirely.
 *
 * @param content The content for the title of the Embed to contain.
 * @param url The URL for the masked link used by the title.
 *
 * @return This {@link Embed}.
 *
 * @throws IllegalArgumentException if one of the following criteria is met:
 *         <ul>
 *             <li>The content provided is empty.</li>
 *             <li>The length of the content is greater than {@link
 *                 Embed#TEXT_MAX_LENGTH}.</li>
 *             <li>The length of the URL is greater than {@link
 *                 Embed#URL_MAX_LENGTH}.</li>
 *             <li>The URL does not match {@link Embed#URL_PATTERN}.</li>
 *         </ul>
 */
public Embed setTitle(String content, @Nullable String url)
{
    if (content == null)
    {
        this.title = null;
        this.url = null;
    }
    else
    {
        if (content.isEmpty())
            throw new IllegalArgumentException("Title cannot be empty!");
        if (content.length() > TITLE_MAX_LENGTH)
            throw new IllegalArgumentException("Title cannot be longer than " + TITLE_MAX_LENGTH + " characters.");
        if (url!=null && url.isEmpty())
            url = null;
        urlCheck(url);

        this.title = content;
        this.url = url;
    }
    return this;
}
 
Example 34
Project: Lunar   File: AnimationManager.java   Source Code and License 4 votes vote down vote up
/**
 * @param id the animation ID.
 * @return the animation with the supplied ID.
 */
@Nullable
public Animation getAnimationByID(int id) {
    return animationFrames.stream().filter(anim -> anim.getID() == id).findAny().orElse(null);
}
 
Example 35
Project: openjdk-jdk10   File: ServiceFinder.java   Source Code and License 4 votes vote down vote up
public static <T> ServiceFinder<T> find(@NotNull Class<T> service, @Nullable ClassLoader loader, Component component) {
    return new ServiceFinder<T>(service, loader, component);
}
 
Example 36
Project: OpenJSharp   File: PolicyResolver.java   Source Code and License 4 votes vote down vote up
public @Nullable PolicyMap getPolicyMap() {
    return policyMap;
}
 
Example 37
Project: OpenJSharp   File: Stub.java   Source Code and License 4 votes vote down vote up
private Stub(WSServiceDelegate owner, @Nullable Tube master, @Nullable WSPortInfo portInfo, QName portname, BindingImpl binding, @Nullable WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr) {
    Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer());
    try {
        this.owner = owner;
        this.portInfo = portInfo;
        this.wsdlPort = wsdlPort != null ? wsdlPort : (portInfo != null ? portInfo.getPort() : null);
        this.portname = portname;
        if (portname == null) {
            if (portInfo != null) {
                this.portname = portInfo.getPortName();
            } else if (wsdlPort != null) {
                this.portname = wsdlPort.getName();
            }
        }
        this.binding = binding;

        ComponentFeature cf = binding.getFeature(ComponentFeature.class);
        if (cf != null && Target.STUB.equals(cf.getTarget())) {
            components.add(cf.getComponent());
        }
        ComponentsFeature csf = binding.getFeature(ComponentsFeature.class);
        if (csf != null) {
            for (ComponentFeature cfi : csf.getComponentFeatures()) {
                if (Target.STUB.equals(cfi.getTarget()))
                    components.add(cfi.getComponent());
            }
        }

        // if there is an EPR, EPR's address should be used for invocation instead of default address
        if (epr != null) {
            this.requestContext.setEndPointAddressString(epr.getAddress());
        } else {
            this.requestContext.setEndpointAddress(defaultEndPointAddress);
        }
        this.engine = new Engine(getStringId(), owner.getContainer(), owner.getExecutor());
        this.endpointReference = epr;
        wsdlProperties = (wsdlPort == null) ? new WSDLDirectProperties(owner.getServiceName(), portname) : new WSDLPortProperties(wsdlPort);

        this.cleanRequestContext = this.requestContext.copy();

        // ManagedObjectManager MUST be created before the pipeline
        // is constructed.

        managedObjectManager = new MonitorRootClient(this).createManagedObjectManager(this);

        if (master != null) {
            this.tubes = new TubePool(master);
        } else {
            this.tubes = new TubePool(createPipeline(portInfo, binding));
        }

        addrVersion = binding.getAddressingVersion();

        // This needs to happen after createPipeline.
        // TBD: Check if it needs to happen outside the Stub constructor.
        managedObjectManager.resumeJMXRegistration();
    } finally {
        ContainerResolver.getDefault().exitContainer(old);
    }
}
 
Example 38
Project: OpenJSharp   File: ClientMessageHandlerTube.java   Source Code and License 4 votes vote down vote up
/**
 * Creates a new instance of MessageHandlerTube
 */
public ClientMessageHandlerTube(@Nullable SEIModel seiModel, WSBinding binding, WSDLPort port, Tube next) {
    super(next, port, binding);
    this.seiModel = seiModel;
}
 
Example 39
Project: openjdk-jdk10   File: HeaderList.java   Source Code and License 4 votes vote down vote up
/**
 * @deprecated
 *      Use {@link #get(QName)}
 */
public
@Nullable
Header get(@NotNull QName name) {
    return get(name, true);
}
 
Example 40
Project: openjdk-jdk10   File: WsaServerTube.java   Source Code and License 4 votes vote down vote up
protected boolean isAnonymousRequired(@Nullable WSDLBoundOperation wbo) {
    //this requirement can only be specified in W3C case, Override this in W3C case.
    return false;
}