Examples of MetaType


Examples of com.puppetlabs.geppetto.pp.pptp.MetaType

          break;

        case META: {
          PPTypeInfo info = helper.getMetaTypeInfo(uri.path(), new InputStreamReader(inputStream));

          MetaType type = PPTPFactory.eINSTANCE.createMetaType();
          type.setName(info.getTypeName());
          type.setDocumentation(info.getDocumentation());
          for(Map.Entry<String, PPTypeInfo.Entry> entry : info.getParameters().entrySet()) {
            Parameter parameter = PPTPFactory.eINSTANCE.createParameter();
            parameter.setName(entry.getKey());
            parameter.setDocumentation(entry.getValue().documentation);
            parameter.setRequired(entry.getValue().isRequired());
            type.getParameters().add(parameter);
          }
          // TODO: Scan the puppet source for providers for the type
          // This is a CHEAT -
          // https://github.com/puppetlabs/geppetto/issues/37
          Parameter p = PPTPFactory.eINSTANCE.createParameter();
          p.setName("provider");
          p.setDocumentation("");
          p.setRequired(false);
          type.getParameters().add(p);

          getContents().add(type);
          break;
        }

        case TYPEFRAGMENT: {
          for(PPTypeInfo type : helper.getTypeFragments(uri.path(), new InputStreamReader(inputStream))) {
            TypeFragment fragment = PPTPFactory.eINSTANCE.createTypeFragment();
            fragment.setName(type.getTypeName());

            // add the properties (will typically load just one).
            for(Map.Entry<String, PPTypeInfo.Entry> entry : type.getProperties().entrySet()) {
              Property property = PPTPFactory.eINSTANCE.createProperty();
              property.setName(entry.getKey());
              property.setDocumentation(entry.getValue().documentation);
              property.setRequired(entry.getValue().isRequired());
              fragment.getProperties().add(property);
            }

            // add the parameters (will typically load just one).
            for(Map.Entry<String, PPTypeInfo.Entry> entry : type.getParameters().entrySet()) {
              Parameter parameter = PPTPFactory.eINSTANCE.createParameter();
              parameter.setName(entry.getKey());
              parameter.setDocumentation(entry.getValue().documentation);
              parameter.setRequired(entry.getValue().isRequired());
              fragment.getParameters().add(parameter);
View Full Code Here

Examples of com.senseidb.indexing.MetaType

        if(type == null)
          throw new IllegalArgumentException("need to specify the type of field in filter json: " + json);
       
        if ("int".equals(type)) {
          MetaType metaType = DefaultSenseiInterpreter.CLASS_METATYPE_MAP.get(int.class);
          String formatString = DefaultSenseiInterpreter.DEFAULT_FORMAT_STRING_MAP.get(metaType);
          DecimalFormat formatter = new DecimalFormat(formatString, new DecimalFormatSymbols(Locale.US));
          fromPadded = formatter.format(Integer.parseInt(from));
          toPadded = formatter.format(Integer.parseInt(to));
        }
        else if ("short".equals(type)) {
          MetaType metaType = DefaultSenseiInterpreter.CLASS_METATYPE_MAP.get(short.class);
          String formatString = DefaultSenseiInterpreter.DEFAULT_FORMAT_STRING_MAP.get(metaType);
          DecimalFormat formatter = new DecimalFormat(formatString, new DecimalFormatSymbols(Locale.US));
          fromPadded = formatter.format(Short.parseShort(from));
          toPadded = formatter.format(Short.parseShort(to));
        }
        else if ("long".equals(type)) {
          MetaType metaType = DefaultSenseiInterpreter.CLASS_METATYPE_MAP.get(long.class);
          String formatString = DefaultSenseiInterpreter.DEFAULT_FORMAT_STRING_MAP.get(metaType);
          DecimalFormat formatter = new DecimalFormat(formatString, new DecimalFormatSymbols(Locale.US));
          fromPadded = formatter.format(Long.parseLong(from));
          toPadded = formatter.format(Long.parseLong(to));
        }
        else if ("date".equals(type)) {
          if(dateFormat == null)
            throw new IllegalArgumentException("Date format cannot be empty in filter json when type is date: " + json);
          else{
            SimpleDateFormat  formatter = new SimpleDateFormat(dateFormat);
            fromPadded = formatter.format(new Date(Long.parseLong(from)));
            toPadded = formatter.format(new Date(Long.parseLong(to)));
          }
        }
        else if ("float".equals(type)) {
          MetaType metaType = DefaultSenseiInterpreter.CLASS_METATYPE_MAP.get(float.class);
          String formatString = DefaultSenseiInterpreter.DEFAULT_FORMAT_STRING_MAP.get(metaType);
          DecimalFormat formatter = new DecimalFormat(formatString, new DecimalFormatSymbols(Locale.US));
          fromPadded = formatter.format(Float.parseFloat(from));
          toPadded = formatter.format(Float.parseFloat(to));
        }
        else if ("double".equals(type)) {
          MetaType metaType = DefaultSenseiInterpreter.CLASS_METATYPE_MAP.get(double.class);
          String formatString = DefaultSenseiInterpreter.DEFAULT_FORMAT_STRING_MAP.get(metaType);
          DecimalFormat formatter = new DecimalFormat(formatString, new DecimalFormatSymbols(Locale.US));
          fromPadded = formatter.format(Double.parseDouble(from));
          toPadded = formatter.format(Double.parseDouble(to));
        }
View Full Code Here

Examples of ek.rms.rtcAssignment.MetaType

  }
 
  private boolean validateInputData(RTCAssignmentType _input) {
   
    //check input <Meta> data
    MetaType _inputMeta = _input.getMeta();
    if (_inputMeta.getMessageTime() == null
        || isNullOrEmptyStr(_inputMeta.getType())
        || isNullOrEmptyStr(_inputMeta.getSubtype())){
      LOG.debug("Mandatory data for Meta are missing. Message dropped.");
      return false;
    }
    if (!"REA".equalsIgnoreCase(_inputMeta.getType())) {
      LOG.debug("Meta Type is not REA. Message dropped.");
      return false;
    }
    String subType = _inputMeta.getSubtype();
    if(!subType.matches("INS|UPD|DEL")){
      LOG.debug("Meta SubType is not equal to (INS or UPD or DEL). Message dropped.");
      return false;
    }
   
View Full Code Here

Examples of org.hibernate.type.MetaType

  public Type getType() throws MappingException {
    return new AnyType(
      metaValues==null ?
        TypeFactory.heuristicType(metaTypeName) :
        new MetaType( metaValues, TypeFactory.heuristicType(metaTypeName) ),
        TypeFactory.heuristicType(identifierTypeName)
    );
  }
View Full Code Here

Examples of org.jboss.errai.codegen.framework.meta.MetaType

      for (MetaClass iface : type.getInterfaces()) {
        if (iface.getFullyQualifiedName().equals(Provider.class.getName())) {
          injectFactory.addType(type);

          MetaParameterizedType pType = iface.getParameterizedType();
          MetaType typeParm = pType.getTypeParameters()[0];
          if (typeParm instanceof MetaParameterizedType) {
            bindType = (MetaClass) ((MetaParameterizedType) typeParm).getRawType();
          }
          else {
            bindType = (MetaClass) pType.getTypeParameters()[0];
          }

          boolean isContextual = false;
          for (MetaField field : type.getDeclaredFields()) {
            if (field.isAnnotationPresent(Inject.class)
                    && field.getType().isAssignableTo(ContextualProviderContext.class)) {

              isContextual = true;
              break;
            }
          }

          if (isContextual) {
            injectFactory.addInjector(new ContextualProviderInjector(bindType, type, procContext));
          }
          else {
            injectFactory.addInjector(new ProviderInjector(bindType, type, procContext));
          }
          break;
        }

        if (iface.getFullyQualifiedName().equals(ContextualTypeProvider.class.getName())) {
          contextual = true;

          MetaParameterizedType pType = iface.getParameterizedType();

          if (pType == null) {
            throw new InjectionFailure("could not determine the bind type for the IOCProvider class: "
                    + type.getFullyQualifiedName());
          }

          // todo: check for nested type parameters
          MetaType typeParm = pType.getTypeParameters()[0];
          if (typeParm instanceof MetaParameterizedType) {
            bindType = (MetaClass) ((MetaParameterizedType) typeParm).getRawType();
          }
          else {
            bindType = (MetaClass) pType.getTypeParameters()[0];
View Full Code Here

Examples of org.jboss.errai.codegen.meta.MetaType

        }
        out.println();

        for (MetaField field : getAllFields(pageClass)) {
          if (field.getType().getErased().equals(transitionToType)) {
            MetaType targetPageType = field.getType().getParameterizedType().getTypeParameters()[0];
            String targetPageName = pages.inverse().get(targetPageType);

            // entry for the link between nodes
            out.println("\"" + pageName + "\" -> \"" + targetPageName + "\" [label=\"" + field.getName() + "\"]");
          }
View Full Code Here

Examples of org.jboss.errai.ioc.rebind.ioc.codegen.meta.MetaType

  private void resolveTypeVariables() {
    int methodParmIndex = 0;
    for (MetaType methodParmType : method.getGenericParameterTypes()) {
      Statement parm = callParameters.getParameters().get(methodParmIndex);

      MetaType callParmType;
      if (parm instanceof ClassLiteral) {
        callParmType = ((ClassLiteral) parm).getActualType();
      }
      else {
        callParmType = parm.getType();
View Full Code Here

Examples of org.jboss.metatype.api.types.MetaType

  public void build(DeploymentUnit unit, Set<String> outputs, Map<String, ManagedObject> managedObjects) throws DeploymentException {
    if (isBuildManagedObject()) {
      ManagedObject mo = managedObjects.get(TranslatorMetaDataGroup.class.getName());
      if (mo != null) {
        ManagedProperty translators = mo.getProperty("translators"); //$NON-NLS-1$
        MetaType propType = translators.getMetaType();
        if (propType.isCollection()) {
          CollectionValue value = (CollectionValue) translators.getValue();
          if (value != null) {
            for (MetaValue element:value.getElements()) {
              ManagedObject translator = (ManagedObject)((GenericValue)element).getValue();
              managedObjects.put(translator.getName(), translator);
View Full Code Here

Examples of org.jboss.metatype.api.types.MetaType

  public static boolean sameValue(MetaValue v1, String v2) {
    if (v1 == null || v2 == null) {
      return false;
    }
   
    MetaType type = v1.getMetaType();
    if (v1 instanceof SimpleValue && type instanceof SimpleMetaType) {
      SimpleMetaType st = (SimpleMetaType)type;
      SimpleValue sv = wrap(st, v2);
      return sv.compareTo((SimpleValue)v1) == 0;
    }
View Full Code Here

Examples of org.jboss.metatype.api.types.MetaType

    return metaValue;
 
 
  public static String stringValue(MetaValue v1) {
    if (v1 != null) {
      MetaType type = v1.getMetaType();
      if (type instanceof SimpleMetaType) {
        SimpleValue simple = (SimpleValue)v1;
        return simple.getValue().toString();
      }
      throw new TeiidRuntimeException("Failed to convert value to string value"); //$NON-NLS-1$
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.