Examples of Resource

  • org.eclipse.bpmn2.Resource
    A representation of the model object 'Resource'.

    The following features are supported:

    @see org.eclipse.bpmn2.Bpmn2Package#getResource() @model extendedMetaData="name='tResource' kind='elementOnly'" @generated
  • org.eclipse.core.internal.resources.Resource
  • org.eclipse.emf.ecore.resource.Resource
    A persistent document.

    A resource of an appropriate type is {@link Factory#createResource created} by a resource factory;a resource set indirectly {@link ResourceSet#createResource(URI) creates} a resource using such a factory.A resource is typically {@link #getResourceSet contained} by a resource set,along with related resources. It has a {@link #getURI URI} representing it's identityand that URI is {@link org.eclipse.emf.ecore.resource.URIConverter used}to determine where to {@link #save(Map) save} and {@link #load(Map) load}. It provides modeled {@link #getContents contents}, in fact, it provides even the {@link #getAllContents tree} of modeled contents,as well as {@link Diagnostic diagnostics} for {@link #getErrors errors} and {@link #getWarnings other} problems.It may be {@link #unload unloaded} to discard the contents and the load state can be {@link #isLoaded queried}. {@link #isModified Modification} can be {@link #isTrackingModification tracked}, but it's expensive. The resource will be informed as objects are {@link Resource.Internal#attached attached} and {@link Resource.Internal#detached detached}; if needed, it will be able to maintain a map to support {@link #getEObject getEObject}. Structured URI {@link #getURIFragment fragments} are used rather than IDs, since they are a more general alternative.Clients must extend the default {@link org.eclipse.emf.ecore.resource.impl.ResourceImpl implementation}, or one of its derived classes, since methods can and will be added to this API.

    A resource produces notification for changes to the value of each of these features:

    @see org.eclipse.emf.common.notify @see org.eclipse.emf.ecore.resource.impl.ResourceImpl @see Factory @see ResourceSet @see URIConverter
  • org.eclipse.jetty.plus.jndi.Resource
    Resource
  • org.eclipse.jetty.util.resource.Resource
    Abstract resource class.

    This class provides a resource abstraction, where a resource may be a file, a URL or an entry in a jar file.

  • org.eclipse.sapphire.Resource
    @author Konstantin Komissarchik
  • org.eclipse.swt.graphics.Resource
    .org/swt/">Sample code and further information @since 3.1
  • org.elasticsearch.hadoop.rest.Resource
    ElasticSearch Rest Resource - index and type.
  • org.exist.util.io.Resource
    eXist's resource. It extend java.io.File @author Dmitriy Shabanov
  • org.exoplatform.portal.resource.Resource
    Represents a resource. @author Julien Viet @version $Revision$
  • org.exoplatform.services.jcr.webdav.resource.Resource
    Created by The eXo Platform SARL .
    WebDAV applicable abstraction of REST Resource definition (by Fielding: "Any information that can be named can be a resource... In other words: any concept that might be the target of an author's hypertext reference must fit within the definition of a resource") Here the REST resource abstraction is some narrowed to the WebDAV needs @author Gennady Azarenkov @version $Id: $
  • org.fao.gast.lib.Resource
  • org.fenixedu.academic.ui.struts.action.teacher.siteArchive.Resource
    A Resource represents something that needs to be retrieved by the {@link org.fenixedu.academic.ui.struts.action.teacher.siteArchive.Fetcher} .

    A Resource defines a local name for the content being retrieved and the url from where the content will be retrieved. The name must not start with '/' but can represent a complex path like "parent/dir/file".

    Additionaly you can add rules to the resource. This rules are to be applyed by the {@link org.fenixedu.academic.ui.struts.action.teacher.siteArchive.Fetcher} to the content of the resource. @author cfgi

  • org.flywaydb.core.internal.util.scanner.Resource
  • org.freerealm.resource.Resource
    @author Deniz ARIKAN
  • org.fusesource.restygwt.client.Resource
    chirino.com">Hiram Chirino
  • org.g4studio.core.resource.Resource
    Resource @author HuangYunHui|XiongChun @since 2009-11-20
  • org.gatein.management.rest.content.Resource
    @author Nick Scavelli @version $Revision$
  • org.geoserver.platform.resource.Resource
    Resource used for configuration storage. Resources represent {@link Type#DIRECTORY}, {@link Type#RESOURCE} and {@link Type#UNDEFINED} content and is primarily used to manage configurationinformation. Resource creation is handled in a lazy fashion, simply use {@link #file()} or {@link #out()} and the resource will be created as required. In asimilar fashion setting up a child resource will create any required parent directories.
  • org.geowebcache.io.Resource
  • org.glassfish.jersey.server.model.Resource
    ster the annotated resource. ResourceConfig resourceConfig = new ResourceConfig(HelloResource.class); // Add new "hello2" resource using the annotated resource class // and overriding the resource path. Resource.Builder resourceBuilder = Resource.builder(HelloResource.class, new LinkedList<ResourceModelIssue>()) .path("hello2"); // Add a new (virtual) sub-resource method to the "hello2" resource. resourceBuilder.addChildResource("world").addMethod("GET") .produces("text/plain") .handledBy(new Inflector<Request, String>() { @Override public String apply(Request request) { return "Hello World!"; } }); // Register the new programmatic resource in the application's configuration. resourceConfig.registerResources(resourceBuilder.build()); The following table illustrates the supported requests and provided responses for the application configured in the example above.
    RequestResponseMethod invoked
    {@code "GET /hello"} {@code "Hello!"} {@code HelloResource.sayHello()}
    {@code "GET /hello2"} {@code "Hello!"} {@code HelloResource.sayHello()}
    {@code "GET /hello2/world"} {@code "Hello World!"} {@code Inflector.apply()}

    @author Marek Potociar (marek.potociar at oracle.com) @author Miroslav Fuksa (miroslav.fuksa at oracle.com)
  • org.glassfish.resource.common.Resource
    Class which represents the Resource.
  • org.glassfish.resources.api.Resource
    Class which represents the Resource.
  • org.globus.wsrf.Resource
  • org.gradle.api.internal.resource.Resource
    A {@code Resource} represents some binary artifact.

    Implementations are not required to be thread-safe.

  • org.gradle.internal.resource.Resource
    A {@code Resource} represents some binary artifact.

    Implementations are not required to be thread-safe.

    This type will be merged with {@link ExternalResource} and friends.

  • org.grails.io.support.Resource
    Interface for a resource descriptor that abstracts from the actual type of underlying resource, such as a file or class path resource.

    An InputStream can be opened for every resource if it exists in physical form, but a URL or File handle can just be returned for certain resources. The actual behavior is implementation-specific. @author Juergen Hoeller @since 28.12.2003 @see #getURL() @see #getURI() @see #getFile()

  • org.hivedb.meta.Resource
    An index entity in the Hive. @author Kevin Kelm (kkelm@fortress-consulting.com) @author Andy Likuski (alikuski@cafepress.com)
  • org.jahia.services.render.Resource
    A resource is the aggregation of a node and a specific template It's something that can be handled by the render engine to be displayed. @author toto
  • org.jamesii.gui.application.resource.Resource
    Stores an object using a soft reference. It also keeps the {@link #lastUsage}flag up to date whenever {@link #getResource()} is called. @author Stefan Rybacki
  • org.jbehave.core.io.rest.Resource
    Represents a resource retrieved from a REST API.
  • org.jboss.aesh.io.Resource
    FileResource is a Aesh native io class. The default implementation is based on java.io.File, but it can be specified by the Settings object when it needs to be overridden. @author Ståle W. Pedersen
  • org.jboss.as.controller.registry.Resource
    A addressable resource in the management model, representing a local model and child resources.

    Instances of this class are not thread-safe and need to be synchronized externally. @author Emanuel Muckenhuber

  • org.jboss.cache.aop.test.Resource
    Test class for PojoCache using annotation. This represents a special resource type that can be declared @Transient. That is, it is neither PojoCacheable nor Serializable. @version $Revision: 2954 $
  • org.jboss.dashboard.ui.resources.Resource
    This class represents a graphic resource.
  • org.jboss.gravia.resource.Resource
    A resource is associated with Capabilities/Requirements. @author thomas.diesler@jboss.com @since 02-Jul-2010
  • org.jboss.modules.Resource
    A single resource from a {@link ResourceLoader}. @author David M. Lloyd
  • org.jboss.profileservice.spi.repository.Resource
    Mirror the OBR Resource view. A resource is an abstraction of a downloadable thing, like a bundle. Resources have capabilities and requirements. All a resource's requirements must be satisfied before it can be installed. @version $Revision: 65457 $
  • org.jboss.resteasy.skeleton.key.idm.model.data.Resource
    @author Bill Burke @version $Revision: 1 $
  • org.jboss.security.authorization.Resource
    Resource that is subject to Authorization Decisions @author Anil Saldhana @since Jun 11, 2006 @version $Revision: 59231 $
  • org.jboss.switchboard.spi.Resource
  • org.jboss.test.jbossmx.compliance.modelmbean.support.Resource
  • org.jboss.test.jbossmx.implementation.persistence.support.Resource
  • org.jboss.test.jmx.compliance.modelmbean.support.Resource
  • org.jboss.testharness.impl.packaging.Resource
  • org.jclouds.chef.domain.Resource
    Resource object. @author Adrian Cole @author Ignasi Barrera
  • org.jclouds.savvis.vpdc.domain.Resource
    Location of a Rest resource @author Adrian Cole
  • org.jdesktop.wonderland.server.security.Resource
    A resource that may have protected access. @author jkaplan
  • org.jfree.resourceloader.Resource
    A resource is a wrapper around the final product. It shall not hold any references to the ResourceData object used to create the resource (to allow efficient 2-stage caching). Although this interfaces declares to be serializable, this might not be the case for some of the content contained in the resource object. Cache implementors should be aware of that issue and should act accordingly (for instance by not caching that object). @author Thomas Morgner
  • org.jrdf.graph.Resource
    A resource stands for either a Blank Node or a URI Reference. This is a convienence interface designed to make it easier to create triples programmatically.
  • org.jwall.web.policy.Resource
  • org.kie.api.io.Resource
  • org.kie.io.Resource
  • org.libreplan.business.resources.entities.Resource
    This class acts as the base class for all resources. @author Fernando Bellas Permuy @author Susana Montes Pedreira @author Jacobo Aragunde Perez
  • org.lilyproject.runtime.rapi.ModuleSource.Resource
  • org.milyn.delivery.annotation.Resource
  • org.mojavemvc.annotations.Resource
  • org.mortbay.jetty.plus.naming.Resource
    Resource
  • org.mortbay.resource.Resource
    Abstract resource class. @author Nuno Pregui�a @author Greg Wilkins (gregw)
  • org.mortbay.util.Resource
  • org.oasis.wsrp.v2.Resource
    3.org/2001/XMLSchema}anyType"> <sequence> <element name="values" type="{urn:oasis:names:tc:wsrp:v2:types}ResourceValue" maxOccurs="unbounded"/> <element name="extensions" type="{urn:oasis:names:tc:wsrp:v2:types}Extension" maxOccurs="unbounded" minOccurs="0"/> </sequence> <attribute name="resourceName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> </restriction> </complexContent> </complexType>
  • org.omg.CosTransactions.Resource
    Generated from IDL interface "Resource". @author JacORB IDL compiler V 2.3.2 (JBoss patch 0), 23-Dec-2011 @version generated at Apr 17, 2012 2:17:22 PM
  • org.onebusaway.presentation.services.resources.Resource
  • org.onemind.swingweb.resource.Resource
    Interface for resource that can be retrieved using getInputStream. IMPORTANT: The subclass must override the hashCode() and equals() to indicate the underlying resource is the same so that the caching of the resource can be done appropriately. @author TiongHiang Lee (thlee@onemindsoft.org)
  • org.ontoware.rdf2go.model.node.Resource
    Marker interface for RDF resources (BlankNode and URI). Must have valid implementations of
     public boolean equals(Object other); public int hashCode(); 
    @author voelkel
  • org.openqa.jetty.util.Resource
    Abstract resource class. @version $Id: Resource.java,v 1.31 2005/10/21 11:36:56 gregwilkins Exp $ @author Nuno Pregui�a @author Greg Wilkins (gregw)
  • org.openrdf.model.Resource
    The supertype of all RDF resources (URIs and blank nodes).
  • org.opensaml.util.resource.Resource
    An interface representing an data resource.
  • org.optaplanner.examples.cheaptime.domain.Resource
  • org.optaplanner.examples.projectjobscheduling.domain.resource.Resource
  • org.osforce.connect.entity.system.Resource
    ourceforce.org">开源力量
  • org.osgi.framework.resource.Resource
    A resource is the representation of a uniquely identified and typed data. A resources can be wired together via capabilities and requirements. @ThreadSafe @version $Id: 56916cb2597067bdf63e757c078787eccebf3953 $
  • org.osgi.resource.Resource
    A resource is the representation of a uniquely identified and typed data. A resource declares requirements that need to be satisfied by capabilities before it can provide its capabilities.

    Instances of this type must be effectively immutable. That is, for a given instance of this interface, the methods defined by this interface must always return the same result. @ThreadSafe @author $Id: c7b6462fb53b38ac3071d7ba73af9dad2af6b9ce $

  • org.osgi.service.indexer.Resource
  • org.osgi.service.obr.Resource
    A resource is an abstraction of a downloadable thing, like a bundle. Resources have capabilities and requirements. All a resource's requirements must be satisfied before it can be installed. @version $Revision: 1.5 $
  • org.pentaho.reporting.libraries.resourceloader.Resource
    A resource is a wrapper around the final product. It shall not hold any references to the ResourceData object used to create the resource (to allow efficient 2-stage caching). Although this interfaces declares to be serializable, this might not be the case for some of the content contained in the resource object. Cache implementors should be aware of that issue and should act accordingly (for instance by not caching that object). @author Thomas Morgner
  • org.primefaces.component.resource.Resource
  • org.qi4j.library.rest.common.Resource
    Value representing a whole resource in a URL path. Allows listing of available queries, commands, sub-resources and an index.
  • org.raml.model.Resource
  • org.raptorjs.resources.Resource
  • org.restlet.resource.Resource
  • org.rhq.core.domain.resource.Resource
    Represents an RHQ managed resource (i.e. a platform, server, or service).
  • org.rhq.modules.integrationTests.restApi.d.Resource
    A resource for testing purposes @author Heiko W. Rupp
  • org.rhq.plugins.perftest.scenario.Resource
  • org.ringojs.repository.Resource
    Resource represents a pointer to some kind of information (code, skin, ...) from which the content can be fetched
  • org.semanticweb.yars.nx.Resource
  • org.simpleframework.http.resource.Resource
    A Resource provides an abstraction of any given object that can be retrieved using a HTTP request. The reason for having this abstraction is to simplify the interface with any given Resource.

    This is similar in design to a Container, however this is intended to handle a single resource. At any time a container may manage many resources all of which are resolved using a ResourceEngine implementation. So in essence this is used to identify a component that can handle a HTTP request routed by a resource engine. @author Niall Gallagher

  • org.sonar.api.resources.Resource
    The interface to implement to create a resource in Sonar @since 1.10
  • org.sonar.wsclient.services.Resource
  • org.springframework.core.io.Resource
    Interface for a resource descriptor that abstracts from the actual type of underlying resource, such as a file or class path resource.

    An InputStream can be opened for every resource if it exists in physical form, but a URL or File handle can just be returned for certain resources. The actual behavior is implementation-specific. @author Juergen Hoeller @since 28.12.2003 @see #getInputStream() @see #getURL() @see #getURI() @see #getFile() @see FileSystemResource @see ClassPathResource @see UrlResource @see ByteArrayResource @see InputStreamResource @see org.springframework.web.context.support.ServletContextResource

  • org.springframework.roo.project.Resource
    Simplified immutable representation of a Maven resource.

    Structured after the model used by Maven. @author Alan Stewart @since 1.1

  • org.structr.rest.resource.Resource
    Base class for all resource constraints. Constraints can be combined with succeeding constraints to avoid unneccesary evaluation. @author Christian Morgner
  • org.teavm.platform.metadata.Resource

    Marks a valid resource interface. Resource interface is an interface, that has get* and set* methods, according the default convention for JavaBeans. Each property must have both getter and setter. Also each property's must be either primitive value (except for long) or a valid resource.

    @see MetadataGenerator @see ResourceArray @see ResourceMap @author Alexey Andreev
  • org.teiid.query.metadata.TransformationMetadata.Resource
  • org.thechiselgroup.choosel.core.client.resources.Resource
  • org.tools.io.Resource
    Resources function as abstract files for us. They provide input and output streams for io activity. Whether a file is located in the file system or inside an archive (jar/zip) or in the memory is hidden by this framework. Additional functionality includes an existence-check, possibility to clear or create new, and list other files (contained in a directory).
  • org.tubo.resource.Resource
    Created: Jun 28, 2006 8:36:17 AM Last Modification Date: $Date: 2006-10-19 10:11:35 -0500 (Thu, 19 Oct 2006) $ @author jvlio (jvlio@users.sourceforge.net) @version $Revision: 17 $
  • org.w3c.tools.resources.Resource
    The resource class describes an object, accessible through the server. Resource objects are required to have the following properties:

    These resource objects do not define how they are accessed. See the sub-classes for specific accesses.

  • org.woped.quantana.resourcealloc.Resource
  • org.wso2.carbon.dataservices.core.description.resource.Resource
    Represents a resource within a data service.
  • org.wso2.carbon.jarservices.stub.types.Resource
  • org.wso2.carbon.registry.api.Resource
    Interface to represent a resource that is stored on the registry. Each resource will have some metadata and content. Resources can also have properties, and versions.

    In addition to that, the registry APIs can be used to create associations between resources, rate or comment on resources, and to create search tags.

  • org.wso2.carbon.registry.core.Resource
    Interface to represent a resource.
  • org.xmldb.api.base.Resource
    Resource is a container for data stored within the database. Raw resources are not particulary useful. It is necessary to have a resource implementation that provides handling for a specific content type before anything useful can be done.
  • org.xrace.model.Resource
    Représente un lien vers une ressource. @author Sherif Behna
  • org.xsocket.Resource
  • org.zanata.apicompat.rest.dto.resource.Resource
  • org.zanata.rest.dto.resource.Resource
  • org.zeroexchange.model.resource.Resource
    The base class for the object-specific entities. @author black
  • org.zeroturnaround.javarebel.Resource
  • pt.opensoft.resource.Resource
  • railo.commons.io.res.Resource
    a Resource handle connection to different resources in a abstract form
  • rcl.internal.Resource
    @author Mischael Schill
  • resource.Resource
    @author Marco Celesti
  • ro.isdc.wro.model.resource.Resource
    Encapsulates information about a resource. This class is not final because we need to mock it in unit tests. @author Alex Objelean @created Created on Oct 30, 2008
  • soj.internal.Resource
    @author Mischael Schill
  • sun.misc.Resource
    This class is used to represent a Resource that has been loaded from the class path. @author David Connelly @since 1.2
  • swarm.sim.Resource
    Represents a consumable resource in a simulation. It can be consumed by agents via the eat() method and can decay via the tick() method
  • tagRecommendation.folksonomyDatatypes.Resource
    @author smbourge
  • test.compliance.modelmbean.support.Resource
  • test.implementation.persistence.support.Resource
  • test.implementation.util.support.Resource
    @author Juha Lindfors. @version $Revision: 1.1 $
  • test.performance.modelmbean.support.Resource
  • uk.ac.osswatch.simal.model.jena.Resource
  • uk.ac.soton.itinnovation.pes.data.model.Resource
  • webit.script.loaders.Resource

  • Examples of org.simpleframework.http.resource.Resource

        private final CiEyeResourceEngine engine = new CiEyeResourceEngine(landscapeFetcher, pictureFetcher, configurationFetcher,
                                                                           tracker, intermediary, updateChecker);
       
        @Test public void
        resolvesWelcomePage() {
            final Resource resource = engine.resolve(new AddressParser("http://ci-eye/"));
            assertThat(resource, is(instanceOf(CiEyeResource.class)));
        }
    View Full Code Here

    Examples of org.sonar.api.resources.Resource

       * file-level)
       */
      public boolean saveViolation(Project project, SensorContext context, String ruleRepoKey,
        String filename, String line, String ruleId, String msg) {
        boolean add = false;
        Resource resource = null;
        int lineNr = 0;

        if ((filename != null) && (filename.length() > 0)) { // file level
          String normalPath = CxxUtils.normalizePath(filename);
          if (normalPath != null) {
    View Full Code Here

    Examples of org.sonar.wsclient.services.Resource

          ImmutableSet.Builder<SonarIssue> entriesBuilder = ImmutableSet.builder();
          final Settings settings = SettingsUtil.getSettingsFor(psiFile);
          if (settings == null) continue;
          final Collection<Resource> resources = settings.getResources();
          if (resources == null || resources.isEmpty()) {
            matchFileByResource(fullFilePath, entriesBuilder, new Resource());
          } else {
            for (Resource resource : resources) {
              matchFileByResource(fullFilePath, entriesBuilder, resource);
            }
          }
    View Full Code Here

    Examples of org.springframework.core.io.Resource

        }

        private HttpServletRequest getRequest()
                throws IOException
        {
            Resource resource = new ClassPathResource("/org/codehaus/xfire/spring/echoRequest.xml");
            byte[] bytes = FileCopyUtils.copyToByteArray(resource.getInputStream());
            MockHttpServletRequest request = new MockHttpServletRequest("POST", "/Echo");
            request.setContentType("text/xml");
            request.setContent(bytes);
            return request;
        }
    View Full Code Here

    Examples of org.springframework.roo.project.Resource

        private List<Resource> getResources(final String xPathExpression,
                final Element configuration) {
            final List<Resource> resources = new ArrayList<Resource>();
            for (final Element resourceElement : XmlUtils.findElements(
                    xPathExpression + "/resources/resource", configuration)) {
                resources.add(new Resource(resourceElement));
            }
            return resources;
        }
    View Full Code Here

    Examples of org.structr.rest.resource.Resource

            boolean found = false;
           
            // check views first
            if (propertyViews.contains(part)) {
           
              Resource resource = new ViewFilterResource();
              resource.checkAndConfigure(part, securityContext, request);
              resource.configureIdProperty(defaultIdProperty);
              resource.configurePropertyView(propertyView);
             
              resourceChain.add(resource);
             
              // mark this part as successfully parsed
              found = true;
             
            } else {

              // look for matching pattern
              for (Map.Entry<Pattern, Class<? extends Resource>> entry : resourceMap.entrySet()) {

                Pattern pattern = entry.getKey();
                Matcher matcher = pattern.matcher(pathParts[i]);

                if (matcher.matches()) {

                  Class<? extends Resource> type = entry.getValue();
                  Resource resource              = null;

                  try {

                    // instantiate resource constraint
                    resource = type.newInstance();
                  } catch (Throwable t) {

                    logger.log(Level.WARNING, "Error instantiating resource class", t);

                  }

                  if (resource != null) {

                    // set security context
                    resource.setSecurityContext(securityContext);

                    if (resource.checkAndConfigure(part, securityContext, request)) {

                      logger.log(Level.FINE, "{0} matched, adding resource of type {1} for part {2}", new Object[] { matcher.pattern(), type.getName(),
                        part });

                      // allow constraint to modify context
                      resource.configurePropertyView(propertyView);
                      resource.configureIdProperty(defaultIdProperty);

                      // add constraint and go on
                      resourceChain.add(resource);

                      found = true;
    View Full Code Here

    Examples of org.teavm.platform.metadata.Resource

            }
            DefaultMetadataGeneratorContext metadataContext = new DefaultMetadataGeneratorContext(context.getClassSource(),
                    context.getClassLoader(), context.getProperties(), context);

            // Generate resource loader
            Resource resource = generator.generateMetadata(metadataContext, methodRef);
            writer.append("if (!window.hasOwnProperty(\"").appendMethodBody(methodRef).append("$$resource\")) {")
                    .indent().softNewLine();
            writer.append("window.").appendMethodBody(methodRef).append("$$resource = ");
            ResourceWriterHelper.write(writer, resource);
            writer.append(';').softNewLine();
    View Full Code Here

    Examples of org.teiid.query.metadata.TransformationMetadata.Resource

        Table table = mf1.addTable("doc");
        table.setSchemaPaths(Arrays.asList("../../x.xsd"));
        table.setResourcePath("/a/b/doc.xmi");
       
        HashMap<String, Resource> resources = new HashMap<String, Resource>();
        resources.put("/x.xsd", new Resource(Mockito.mock(VirtualFile.class), true));
       
        CompositeMetadataStore cms = new CompositeMetadataStore(Arrays.asList(mf.getMetadataStore(), mf1.getMetadataStore()));
       
        VDBMetaData vdb = new VDBMetaData();
        vdb.setName("vdb");
    View Full Code Here

    Examples of org.thechiselgroup.choosel.core.client.resources.Resource

                }
            }

            for (int row = 0; row < table.getRowCount(); row++) {
                String uri = uriType + ":" + row;
                Resource resource = new Resource(uri);

                for (int column = 0; column < table.getColumnCount(); column++) {
                    String stringValue = table.getValue(row, column);

                    /*
                     * TODO should not be parsed at this point - change once setting
                     * property types possible
                     */
                    Serializable value;

                    switch (columnTypes[column]) {
                    case NUMBER:
                        if (!NUMBER_DETECTION_REGEX.test(stringValue)) {
                            throw new ParseException("Invalid number", stringValue,
                                    row + 1);
                        }
                        value = new Double(stringValue);
                        break;
                    case DATE:
                        if (DATE_FORMAT_1_REGEX.test(stringValue)) {
                            value = parseDate1(stringValue);
                        } else if (DATE_FORMAT_2_REGEX.test(stringValue)) {
                            value = parseDate2(stringValue);
                        } else {
                            throw new ParseException("Invalid date", stringValue,
                                    row + 1);
                        }
                        break;
                    case LOCATION:
                        if (!LOCATION_DETECTION_REGEX.test(stringValue)) {
                            throw new ParseException("Invalid location",
                                    stringValue, row + 1);
                        }

                        Resource locationResource = new Resource();
                        String[] split = stringValue.split("\\/");
                        locationResource.putValue(ResourceSetUtils.LATITUDE,
                                Double.parseDouble(split[0]));
                        locationResource.putValue(ResourceSetUtils.LONGITUDE,
                                Double.parseDouble(split[1]));
                        value = locationResource;
                        break;
                    default:
                        value = stringValue;
    View Full Code Here

    Examples of org.tools.io.Resource

            // convert to xml
            Node root = p.toXML();

            // write to file
            Resource location = ResourceUtils.asResource("XMLTest.Property.xml");
            try (OutputStream out = location.getOutputStream()) {
                XMLHelper.write(out, root);
            }
            try (InputStream in = location.getInputStream()) {
                root = XMLHelper.read(in);
            }
            p.fromXML(root);

            // some tests
            Assert.assertTrue(p.size() == 4);
            Assert.assertTrue("mercedes".equals(p.get("car")));
            Assert.assertTrue("cat".equals(p.get("pet")));
            Assert.assertTrue(p.getInt("age") == 21);
            Assert.assertTrue(p.getBoolean("single") == true);

            // TODO this fails, something is not closed correctly

            // delete file again
            Assert.assertTrue(location.delete());

        }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.