Examples of Property


Examples of org.modeshape.common.util.Reflection.Property

        assertThat(props.size(), is(8));
        assertThat(propsByName.size(), is(8));
        assertThat(props.containsAll(propsByName.values()), is(true));

        Property property = propsByName.remove("status");
        assertThat(property.getName(), is("status"));
        assertThat(property.getLabel(), is("Status"));
        assertThat(property.getType().equals(Status.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertThat(property, is(findProperty(property.getName(), props)));
        assertValue(reflection, problem, property, status);

        property = propsByName.remove("code");
        assertThat(property.getName(), is("code"));
        assertThat(property.getLabel(), is("Code"));
        assertThat(property.getType().equals(Integer.TYPE), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, code);

        property = propsByName.remove("message");
        assertThat(property.getName(), is("message"));
        assertThat(property.getLabel(), is("Message"));
        assertThat(property.getType().equals(I18n.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, msg);

        property = propsByName.remove("messageString");
        assertThat(property.getName(), is("messageString"));
        assertThat(property.getLabel(), is("Message String"));
        assertThat(property.getType().equals(String.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, msg.text(params));

        property = propsByName.remove("parameters");
        assertThat(property.getName(), is("parameters"));
        assertThat(property.getLabel(), is("Parameters"));
        assertThat(property.getType().equals(Object[].class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, params);

        property = propsByName.remove("resource");
        assertThat(property.getName(), is("resource"));
        assertThat(property.getLabel(), is("Resource"));
        assertThat(property.getType().equals(String.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, resource);

        property = propsByName.remove("location");
        assertThat(property.getName(), is("location"));
        assertThat(property.getLabel(), is("Location"));
        assertThat(property.getType().equals(String.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, location);

        property = propsByName.remove("throwable");
        assertThat(property.getName(), is("throwable"));
        assertThat(property.getLabel(), is("Throwable"));
        assertThat(property.getType().equals(Throwable.class), is(true));
        assertThat(property.isReadOnly(), is(true));
        assertValue(reflection, problem, property, throwable);

        assertThat(propsByName.isEmpty(), is(true));
    }
View Full Code Here

Examples of org.modeshape.jcr.api.Property

        JcrSession session = repository.login();
        AbstractJcrNode node1 = session.getNode("/node1");
        AbstractJcrNode node2 = session.getNode("/node2");
        AbstractJcrNode node3 = session.getNode("/node3");

        Property hard_ref11 = node1.getProperty("hard_ref11");
        assertEquals(javax.jcr.PropertyType.REFERENCE, hard_ref11.getType());
        assertEquals(node2.getIdentifier(), hard_ref11.getNode().getIdentifier());
        Property hard_ref12 = node1.getProperty("hard_ref12");
        assertEquals(javax.jcr.PropertyType.REFERENCE, hard_ref12.getType());
        assertTrue(hard_ref12.isMultiple());
        List<String> nodeIdentifiers = new ArrayList<>();
        for (Value value : hard_ref12.getValues()) {
            nodeIdentifiers.add(value.getString());
        }
        assertTrue(nodeIdentifiers.remove(node2.getIdentifier()));
        assertTrue(nodeIdentifiers.remove(node3.getIdentifier()));

        Property weak_ref11 = node1.getProperty("weak_ref11");
        assertEquals(javax.jcr.PropertyType.WEAKREFERENCE, weak_ref11.getType());
        assertEquals(node2.getIdentifier(), weak_ref11.getNode().getIdentifier());
        Property weak_ref12 = node1.getProperty("weak_ref12");
        assertEquals(javax.jcr.PropertyType.WEAKREFERENCE, weak_ref12.getType());
        assertEquals(node2.getIdentifier(), weak_ref12.getNode().getIdentifier());

        Property simple_ref11 = node1.getProperty("simple_ref11");
        assertEquals(PropertyType.SIMPLE_REFERENCE, simple_ref11.getType());
        assertEquals(node2.getIdentifier(), simple_ref11.getNode().getIdentifier());
        Property simple_ref12 = node1.getProperty("simple_ref12");
        assertEquals(PropertyType.SIMPLE_REFERENCE, simple_ref12.getType());
        assertEquals(node2.getIdentifier(), simple_ref12.getNode().getIdentifier());

        Property hard_ref21 = node2.getProperty("hard_ref21");
        assertEquals(javax.jcr.PropertyType.REFERENCE, hard_ref21.getType());
        assertEquals(node1.getIdentifier(), hard_ref21.getNode().getIdentifier());
        Property hard_ref22 = node2.getProperty("hard_ref22");
        assertEquals(javax.jcr.PropertyType.REFERENCE, hard_ref22.getType());
        assertTrue(hard_ref22.isMultiple());
        nodeIdentifiers = new ArrayList<>();
        for (Value value : hard_ref22.getValues()) {
            nodeIdentifiers.add(value.getString());
        }
        assertTrue(nodeIdentifiers.remove(node1.getIdentifier()));
        assertTrue(nodeIdentifiers.remove(node3.getIdentifier()));

        Property weak_ref21 = node2.getProperty("weak_ref21");
        assertEquals(javax.jcr.PropertyType.WEAKREFERENCE, weak_ref21.getType());
        assertEquals(node1.getIdentifier(), weak_ref21.getNode().getIdentifier());
        Property weak_ref22 = node2.getProperty("weak_ref22");
        assertEquals(javax.jcr.PropertyType.WEAKREFERENCE, weak_ref22.getType());
        assertEquals(node1.getIdentifier(), weak_ref22.getNode().getIdentifier());

        Property simple_ref21 = node2.getProperty("simple_ref21");
        assertEquals(PropertyType.SIMPLE_REFERENCE, simple_ref21.getType());
        assertEquals(node1.getIdentifier(), simple_ref21.getNode().getIdentifier());
        Property simple_ref22 = node2.getProperty("simple_ref22");
        assertEquals(PropertyType.SIMPLE_REFERENCE, simple_ref22.getType());
        assertEquals(node1.getIdentifier(), simple_ref22.getNode().getIdentifier());
    }
View Full Code Here

Examples of org.modeshape.jcr.value.Property

        }

        // Use a separate system session to set the REFERENCE property on the 'nt:versionLabels' child node ...
        SessionCache system = session.createSystemCache(false);
        Reference labelReference = session.referenceFactory().create(version.key(), true);
        Property ref = session.propertyFactory().create(nameFrom(label), labelReference);
        system.mutable(versionLabels.key()).setProperty(system, ref);
        system.save();
    }
View Full Code Here

Examples of org.moltools.design.properties.Property

    if (tests[0].perform()) {
     
      Sequence target = (Sequence) p.getTarget();
           
      //Check GC
      Property prop = gcanalysis.analyze(target).get(0);
     
      float percentGC = ((Float) prop.getValue()).floatValue();
     
      if (percentGC > maxGC) {
       
          ProbeMakerPropertyUtils.addMessage(p.getTSSPair(),new Message(
            "%GC content in target is too high, " + Math.round(percentGC) + "% (Max set to " + maxGC + "%)", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
View Full Code Here

Examples of org.mongodb.morphia.annotations.Property

     */
    private String getMappedFieldName() {
        if (hasAnnotation(Id.class)) {
            return Mapper.ID_KEY;
        } else if (hasAnnotation(Property.class)) {
            final Property mv = (Property) foundAnnotations.get(Property.class);
            if (!mv.value().equals(Mapper.IGNORED_FIELDNAME)) {
                return mv.value();
            }
        } else if (hasAnnotation(Reference.class)) {
            final Reference mr = (Reference) foundAnnotations.get(Reference.class);
            if (!mr.value().equals(Mapper.IGNORED_FIELDNAME)) {
                return mr.value();
View Full Code Here

Examples of org.neo4j.batchimport.structs.Property

    private void encodeProperties(PropertyHolder holder) {
        if (holder.propertyCount ==0) return;
        // todo cache encoded blocks in an LRU cache
        for (int id = 0; id < holder.propertyCount; id++) {
            Property value = holder.properties[id];
            value.encode(propStore);
            count++;
        }
    }
View Full Code Here

Examples of org.oasis.wsrp.v2.Property

   {
      public Property apply(V1Property from)
      {
         if (from != null)
         {
            Property result = WSRPTypeFactory.createProperty(from.getName(), from.getLang(), from.getStringValue());
            result.setType(WSRPConstants.XSD_STRING); // todo: not sure what to do here... :(

            List<Object> any = from.getAny();
            if (ParameterValidation.existsAndIsNotEmpty(any))
            {
               result.getAny().addAll(any);
            }
            return result;
         }
         else
         {
View Full Code Here

Examples of org.oasisopen.sca.annotation.Property

        if (field.isAnnotationPresent(Reference.class)) {
            Reference ref = field.getAnnotation(Reference.class);
            String name = ref.name() != null && !ref.name().equals("") ? ref.name() : field.getName();
            value = ContextHelper.getReference(name, field.getType(), contextLocator.getServletContext());
        } else if (field.isAnnotationPresent(Property.class)) {
            Property prop = field.getAnnotation(Property.class);
            String name = prop.name() != null && !prop.name().equals("") ? prop.name() : field.getName();
            value = ContextHelper.getProperty(name, contextLocator.getServletContext());
        } else if (field.isAnnotationPresent(ComponentName.class)) {
            RuntimeComponent rc = (RuntimeComponent)contextLocator.getServletContext().getAttribute(ContextHelper.COMPONENT_ATTR);
            value = rc.getName();
        } else if (field.isAnnotationPresent(Context.class)) {
View Full Code Here

Examples of org.ofbiz.base.container.ContainerConfig.Container.Property

        if (mount.endsWith("/*")) {
            mount = mount.substring(0, mount.length() - 2);
        }

        // configure persistent sessions
        Property clusterProp = clusterConfig.get(engine.getName());

        Manager sessionMgr = null;
        if (clusterProp != null) {
            String mgrClassName = ContainerConfig.getPropertyValue(clusterProp, "manager-class", "org.apache.catalina.ha.session.DeltaManager");
            try {
View Full Code Here

Examples of org.olap4j.metadata.Property

        this.cellSetMetaData = cellSetMetaData;

        // populate property list
        for (Id id : queryAxis.getDimensionProperties()) {
            final String[] names = id.toStringArray();
            Property property = null;
            if (names.length == 1) {
                property =
                    Util.lookup(
                        Property.StandardMemberProperty.class, names[0]);
            }
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.