Examples of GenericValue


Examples of org.apache.expreval.expr.node.GenericValue

    }

    public Class<? extends GenericValue> validateTypes(final GenericValue parentExpr,
                                                       final boolean allowCollections) throws HBqlException {

        final GenericValue genericValue = this.getExprArg(0);
        final Class<? extends GenericValue> validatedValue = genericValue.validateTypes(this, false);
        final Class<? extends GenericValue> type = this.getGenericValueClass(validatedValue);

        final GenericNullCompare typedExpr;
        if (TypeSupport.isParentClass(StringValue.class, type))
            typedExpr = new StringNullCompare(this.isNot(), this.getExprArg(0));
View Full Code Here

Examples of org.jboss.metatype.api.values.GenericValue

{
    private final Log log = LogFactory.getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);

    public void populateMetaValueFromProperty(PropertyMap propMap, MetaValue metaValue, PropertyDefinitionMap propDefMap)
    {
        GenericValue genericValue = (GenericValue)metaValue;
        if (!(genericValue.getValue() instanceof ManagedObject))
        {
            log.error("GenericValue's value [" + genericValue.getValue() + "] is not a ManagedObject - not supported!");
            return;
        }
        ManagedObject managedObject = (ManagedObject)genericValue.getValue();
        for (String propName : propMap.getMap().keySet())
        {
            Property mapMemberProp = propMap.get(propName);
            ManagedProperty managedProp = managedObject.getProperty(propName);
            MetaType metaType = managedProp.getMetaType();
View Full Code Here

Examples of org.jboss.metatype.api.values.GenericValue

            MetaType managedPropMetaType = ProfileServiceUtil.convertPropertyDefinitionToMetaType(mapMemberPropDef);
            managedProp.setMetaType(managedPropMetaType);
            managedProp.setManagedObject(managedObject);
            managedObject.getProperties().put(managedProp.getName(), managedProp);
        }
        GenericValue genericValue = new GenericValueSupport(new GenericMetaType(propDefMap.getName(),
                propDefMap.getDescription()), managedObject);
        populateMetaValueFromProperty(propMap, genericValue, propDefMap);
        return genericValue;
    }
View Full Code Here

Examples of org.jboss.metatype.api.values.GenericValue

        return genericValue;
    }

    public void populatePropertyFromMetaValue(PropertyMap propMap, MetaValue metaValue, PropertyDefinitionMap propDefMap)
    {
        GenericValue genericValue = (GenericValue)metaValue;
        ManagedObject managedObject = (ManagedObject)genericValue.getValue();
        for (String propName : propDefMap.getPropertyDefinitions().keySet())
        {
            ManagedProperty managedProp = managedObject.getProperty(propName);
            if (managedProp != null)
            {
View Full Code Here

Examples of org.jboss.metatype.api.values.GenericValue

                  {
                     log.debug("Failed to find component for bean: "+bmd.getName());
                     continue;
                  }
                  MetaData compMetaData = compUnit.getMetaData();
                  GenericValue gv = getManagedObjectValue(bmd, compMetaData, bmdfMO);
                  if(gv != null)
                  {
                     // The component managed objects need to be in the root map
                     ManagedObject compMO = (ManagedObject) gv.getValue();
                     // Use the ManagedObject name if it's not the same as the attachmentName
                     String managedObjectName = compUnit.getName();
                     if(compMO != null && compMO.getAttachmentName() != null)
                     {
                        managedObjectName = compMO.getAttachmentName().equals(compMO.getName()) ?
View Full Code Here

Examples of org.jboss.metatype.api.values.GenericValue

   }
  
   protected ManagedComponent createDSComponent(ManagedObject deployment)
   {
      CollectionValue collection = (CollectionValue) deployment.getProperty("deployments").getValue();
      GenericValue generic = (GenericValue) collection.iterator().next();
      ManagedObject mo = (ManagedObject) generic.getValue();
      return createComponent(mo);
   }
View Full Code Here

Examples of org.jboss.metatype.api.values.GenericValue

   protected ManagedComponent createJMSComponent(ManagedObject serviceDeploymentMO)
   {
      assertNotNull(serviceDeploymentMO);
      CollectionValue collection = (CollectionValue) serviceDeploymentMO.getProperty("services").getValue();
      assertNotNull(collection);
      GenericValue topic = (GenericValue) collection.iterator().next();
      assertNotNull(topic);
      ManagedObject topicMO = (ManagedObject) topic.getValue();
      return createComponent(topicMO);
   }
View Full Code Here

Examples of org.jboss.metatype.api.values.GenericValue

   protected ManagedProperty getProperty(ManagedObject serviceDeploymentMO, String propertyName)
   {
      assertNotNull(serviceDeploymentMO);
      CollectionValue collection = (CollectionValue) serviceDeploymentMO.getProperty("services").getValue();
      assertNotNull(collection);
      GenericValue topic = (GenericValue) collection.iterator().next();
      assertNotNull(topic);
      ManagedObject topicMO = (ManagedObject) topic.getValue();
      assertNotNull(topicMO);
     
      // downCacheSize
      return topicMO.getProperty(propertyName);
   }
View Full Code Here

Examples of org.ofbiz.core.entity.GenericValue

    final CustomField fixSlaState = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.FIX_KPI_STATE);       
    final CustomField timeElapsed = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.TIME_ELAPSED);       
    final CustomField onHold = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.ON_HOLD);       

    final Project project = mIssue.getProjectObject();
    final GenericValue securityLevel = mIssue.getSecurityLevel();
   
    final ClientSLAConfig clientSLAConfiguration = SLAServiceJob.getClientSLAConfiguration(securityLevel.getString("name"), project.getName());
    if (clientSLAConfiguration != null)
    {
      User user;
      try {
        user = UserUtils.getUser(SLAServiceJob.getSLAServiceUserName());
View Full Code Here

Examples of org.ofbiz.entity.GenericValue

    public static Map<String, Object> productionRunDeclareAndProduce(DispatchContext ctx, Map<String, ? extends Object> context) {
        Map<String, Object> result = FastMap.newInstance();
        Delegator delegator = ctx.getDelegator();
        LocalDispatcher dispatcher = ctx.getDispatcher();
        Locale locale = (Locale) context.get("locale");
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        // Mandatory input fields
        String productionRunId = (String)context.get("workEffortId");

        // Optional input fields
        BigDecimal quantity = (BigDecimal)context.get("quantity");
        Map<GenericPK, Object> componentsLocationMap = UtilGenerics.checkMap(context.get("componentsLocationMap"));

        // The production run is loaded
        ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);

        BigDecimal quantityProduced = productionRun.getGenericValue().getBigDecimal("quantityProduced");
        BigDecimal quantityToProduce = productionRun.getGenericValue().getBigDecimal("quantityToProduce");
        if (quantityProduced == null) {
            quantityProduced = BigDecimal.ZERO;
        }
        if (quantityToProduce == null) {
            quantityToProduce = BigDecimal.ZERO;
        }
        BigDecimal minimumQuantityProducedByTask = quantityProduced.add(quantity);
        if (minimumQuantityProducedByTask.compareTo(quantityToProduce) > 0) {
            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingQuantityProducedIsHigherThanQuantityDeclared", locale));
        }

        List<GenericValue> tasks = productionRun.getProductionRunRoutingTasks();
        for (int i = 0; i < tasks.size(); i++) {
            GenericValue oneTask = tasks.get(i);
            String taskId = oneTask.getString("workEffortId");
            if ("PRUN_RUNNING".equals(oneTask.getString("currentStatusId"))) {
                BigDecimal quantityDeclared = oneTask.getBigDecimal("quantityProduced");
                if (quantityDeclared == null) {
                    quantityDeclared = BigDecimal.ZERO;
                }
                if (minimumQuantityProducedByTask.compareTo(quantityDeclared) > 0) {
                    try {
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.