Package org.apache.wink.common.internal.uritemplate

Examples of org.apache.wink.common.internal.uritemplate.UriTemplateProcessor$Variable


    }

    private ResourceRecord createStaticResourceRecord(Class<? extends Object> cls,
                                                      ObjectFactory<?> of) {
        ClassMetadata metadata = createMetadata(cls);
        UriTemplateProcessor processor = createUriTemplateProcessor(metadata);
        ResourceRecord record = new ResourceRecord(metadata, of, processor);
        writersLock.lock();
        try {
            // double check so as not to put the same resource twice
            if (cacheByClass.get(cls) == null) {
View Full Code Here


    private ResourceRecord createDynamicResourceRecord(DynamicResource instance, ObjectFactory<?> of) {
        Class<? extends Object> cls = instance.getClass();
        ClassMetadata metadata = createMetadata(cls);
        metadata = fixInstanceMetadata(metadata, instance);
        UriTemplateProcessor processor = createUriTemplateProcessor(metadata);
        return new ResourceRecord(metadata, of, processor);
    }
View Full Code Here

    }

    private ResourceRecord createStaticResourceRecord(Class<? extends Object> cls,
                                                      ObjectFactory<?> of) {
        ClassMetadata metadata = createMetadata(cls);
        UriTemplateProcessor processor = createUriTemplateProcessor(metadata);
        ResourceRecord record = new ResourceRecord(metadata, of, processor);
        writersLock.lock();
        try {
            // double check so as not to put the same resource twice
            if (cacheByClass.get(cls) == null) {
View Full Code Here

    private ResourceRecord createDynamicResourceRecord(DynamicResource instance, ObjectFactory<?> of) {
        Class<? extends Object> cls = instance.getClass();
        ClassMetadata metadata = createMetadata(cls);
        metadata = fixInstanceMetadata(metadata, instance);
        UriTemplateProcessor processor = createUriTemplateProcessor(metadata);
        return new ResourceRecord(metadata, of, processor);
    }
View Full Code Here

                                   List<MethodMetadata> subResourceLocators,
                                   SubResources subResources,
                                   boolean isLocator) {
        for (MethodMetadata subResourceLocator : subResourceLocators) {
            SubResource subResource = resourcesObjectFactory.createSubResource();
            UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
            subResource.setUri(SLASH + uriTemplate.getTemplate() + subResourceLocator.getPath());
            if (isLocator) {
                subResource.setType("Locator");
            } else {
                subResource.setType("Method");
                subResource.setMethod(subResourceLocator.getHttpMethod().toString());
View Full Code Here

        Map<String, Resource> uri2ResourceMap = new HashMap<String, Resource>();

        for (MethodMetadata subResourceLocator : subResourceLocators) {

            UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
            String uri = SLASH + uriTemplate.getTemplate() + subResourceLocator.getPath();
            org.apache.wink.common.internal.model.admin.Methods xmlSRL =
                createXMLSubResourceLocatorMethod(subResourceLocator);
            addResourceMethods(uri2ResourceMap, uri, xmlSRL);
        }

        // Add all Sub Resource Locators as resources
        resources.getResource().addAll(uri2ResourceMap.values());

        uri2ResourceMap.clear();
        for (MethodMetadata subResourceMethod : subResourceMethods) {
            UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
            String uri = SLASH + uriTemplate.getTemplate() + subResourceMethod.getPath();
            org.apache.wink.common.internal.model.admin.Methods xmlSRM =
                createXMLSubResourceMethod(subResourceMethod);
            addResourceMethods(uri2ResourceMap, uri, xmlSRM);
        }
View Full Code Here

    private Resource buildResource(ResourceRecord record) {

        Resource newResource = resourcesObjectFactory.createResource();

        // Add dispatched URIs
        UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
        newResource.setUri(SLASH + uriTemplate.getTemplate());

        // Add Collection/Workspace data
        newResource.setWorkspace(record.getMetadata().getWorkspaceName());
        newResource.setCollection(record.getMetadata().getCollectionTitle());
View Full Code Here

                                   List<MethodMetadata> subResourceLocators,
                                   SubResources subResources,
                                   boolean isLocator) {
        for (MethodMetadata subResourceLocator : subResourceLocators) {
            SubResource subResource = resourcesObjectFactory.createSubResource();
            UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
            subResource.setUri(SLASH + uriTemplate.getTemplate() + subResourceLocator.getPath());
            if (isLocator) {
                subResource.setType("Locator");
            } else {
                subResource.setType("Method");
                subResource.setMethod(subResourceLocator.getHttpMethod().toString());
View Full Code Here

        Map<String, Resource> uri2ResourceMap = new HashMap<String, Resource>();

        for (MethodMetadata subResourceLocator : subResourceLocators) {

            UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
            String uri = SLASH + uriTemplate.getTemplate() + subResourceLocator.getPath();
            org.apache.wink.common.internal.model.admin.Methods xmlSRL =
                createXMLSubResourceLocatorMethod(subResourceLocator);
            addResourceMethods(uri2ResourceMap, uri, xmlSRL);
        }

        // Add all Sub Resource Locators as resources
        resources.getResource().addAll(uri2ResourceMap.values());

        uri2ResourceMap.clear();
        for (MethodMetadata subResourceMethod : subResourceMethods) {
            UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
            String uri = SLASH + uriTemplate.getTemplate() + SLASH + subResourceMethod.getPath();
            org.apache.wink.common.internal.model.admin.Methods xmlSRM =
                createXMLSubResourceMethod(subResourceMethod);
            addResourceMethods(uri2ResourceMap, uri, xmlSRM);
        }
View Full Code Here

    private Resource buildResource(ResourceRecord record) {

        Resource newResource = resourcesObjectFactory.createResource();

        // Add dispatched URIs
        UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
        newResource.setUri(SLASH + uriTemplate.getTemplate());

        // Add Collection/Workspace data
        newResource.setWorkspace(record.getMetadata().getWorkspaceName());
        newResource.setCollection(record.getMetadata().getCollectionTitle());
View Full Code Here

TOP

Related Classes of org.apache.wink.common.internal.uritemplate.UriTemplateProcessor$Variable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.