Examples of FieldName


Examples of com.google.eclipse.protobuf.protobuf.FieldName

    }
    return source;
  }

  private IndexedElement sourceOfNameOf(ComplexValueField field) {
    FieldName name = field.getName();
    return (name == null) ? null : name.getTarget();
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.FieldName

  @Override public void completeSimpleValueField_Value(EObject model, Assignment assignment,
      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    if (model instanceof SimpleValueField) {
      SimpleValueField field = (SimpleValueField) model;
      FieldName name = field.getName();
      if (name != null) {
        IndexedElement target = name.getTarget();
        if (target instanceof MessageField) {
          proposeFieldValue((MessageField) target, context, acceptor);
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.jsio.client.FieldName

   */
  protected String extractFieldName(TreeLogger logger, JMethod m,
      boolean imported) throws UnableToCompleteException {
    logger = logger.branch(TreeLogger.DEBUG, "Extracting field name", null);

    FieldName fieldNameAnnotation = JSWrapperGenerator.hasTag(logger, m,
        FieldName.class);

    if (fieldNameAnnotation == null) {
      // If the method is imported and there's no overriding annotation,
      // just return the methods original name. This ensures that native
      // JS methods that look like bean getter/setters don't get munged.
      if (imported) {
        return m.getName();
      }

      // If no gwt.fieldName is specified, see if there's a naming policy
      // defined on the enclosing class.
      JClassType enclosing = m.getEnclosingType();
      com.google.gwt.jsio.client.NamePolicy namePolicyAnnotation = JSWrapperGenerator.hasTag(
          logger, enclosing, com.google.gwt.jsio.client.NamePolicy.class);
      NamePolicy policy;

      // If there is no namePolicy or it's not of the desired form, default
      // to the JavaBean-style naming policy.
      if (namePolicyAnnotation == null) {
        policy = NamePolicy.BEAN;
        logger.log(TreeLogger.DEBUG, "No useful policy metadata for class",
            null);

      } else {
        // Use the provided name to access fields within NamePolicy
        String policyName = namePolicyAnnotation.value();
        try {
          Field f = NamePolicy.class.getDeclaredField(policyName.toUpperCase());
          policy = (NamePolicy) f.get(null);

        } catch (IllegalAccessException e) {
          logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, e);
          throw new UnableToCompleteException();

        } catch (NoSuchFieldException e) {
          // This means that the value specified is not a field, but likely
          // a class name. Try instantiating one and seeing if it's a
          // subclass of NamePolicy.
          try {
            Class<? extends NamePolicy> clazz = Class.forName(policyName).asSubclass(
                NamePolicy.class);
            policy = clazz.newInstance();
          } catch (ClassCastException ee) {
            logger.log(TreeLogger.ERROR,
                "@gwt.namePolicy is not an implementation of NamePolicy", null);
            throw new UnableToCompleteException();
          } catch (ClassNotFoundException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          } catch (IllegalAccessException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          } catch (InstantiationException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          }
        }
      }

      // Execute the conversion
      String propertyName = TaskFactory.getPropertyNameFromMethod(m);
      return policy.convert(propertyName);

    } else {
      // Use the field name specified on the method
      logger.log(TreeLogger.DEBUG, "Overriding field name based on annotation",
          null);
      return fieldNameAnnotation.value();
    }
  }
View Full Code Here

Examples of com.google.gwt.search.jsio.client.FieldName

   */
  protected String extractFieldName(TreeLogger logger, JMethod m,
      boolean imported) throws UnableToCompleteException {
    logger = logger.branch(TreeLogger.DEBUG, "Extracting field name", null);

    FieldName fieldNameAnnotation = JSWrapperGenerator.hasTag(logger, m,
        FieldName.class);

    if (fieldNameAnnotation == null) {
      // If the method is imported and there's no overriding annotation,
      // just return the methods original name. This ensures that native
      // JS methods that look like bean getter/setters don't get munged.
      if (imported) {
        return m.getName();
      }

      // If no gwt.fieldName is specified, see if there's a naming policy
      // defined on the enclosing class.
      JClassType enclosing = m.getEnclosingType();
      com.google.gwt.search.jsio.client.NamePolicy namePolicyAnnotation = JSWrapperGenerator.hasTag(
          logger, enclosing, com.google.gwt.search.jsio.client.NamePolicy.class);
      NamePolicy policy;

      // If there is no namePolicy or it's not of the desired form, default
      // to the JavaBean-style naming policy.
      if (namePolicyAnnotation == null) {
        policy = NamePolicy.BEAN;
        logger.log(TreeLogger.DEBUG, "No useful policy metadata for class",
            null);

      } else {
        // Use the provided name to access fields within NamePolicy
        String policyName = namePolicyAnnotation.value();
        try {
          Field f = NamePolicy.class.getDeclaredField(policyName.toUpperCase());
          policy = (NamePolicy) f.get(null);

        } catch (IllegalAccessException e) {
          logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, e);
          throw new UnableToCompleteException();

        } catch (NoSuchFieldException e) {
          // This means that the value specified is not a field, but likely
          // a class name. Try instantiating one and seeing if it's a
          // subclass of NamePolicy.
          try {
            Class<? extends NamePolicy> clazz = Class.forName(policyName).asSubclass(
                NamePolicy.class);
            policy = clazz.newInstance();
          } catch (ClassCastException ee) {
            logger.log(TreeLogger.ERROR,
                "@gwt.namePolicy is not an implementation of NamePolicy", null);
            throw new UnableToCompleteException();
          } catch (ClassNotFoundException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          } catch (IllegalAccessException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          } catch (InstantiationException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          }
        }
      }

      // Execute the conversion
      String propertyName = TaskFactory.getPropertyNameFromMethod(m);
      return policy.convert(propertyName);

    } else {
      // Use the field name specified on the method
      logger.log(TreeLogger.DEBUG, "Overriding field name based on annotation",
          null);
      return fieldNameAnnotation.value();
    }
  }
View Full Code Here

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.value.FieldName

        addElementProcessor(new ErrorMessage());
        addElementProcessor(new ErrorReference());
        addElementProcessor(new ExcludeField());
        addElementProcessor(new Feedback());
        addElementProcessor(new FieldLabel());
        addElementProcessor(new FieldName());
        addElementProcessor(new FieldValue());
        addElementProcessor(new FormField());
        addElementProcessor(new FormEntry());
        addElementProcessor(new Forward());
        addElementProcessor(new GetField());
View Full Code Here

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.value.FieldName

        addElementProcessor(new ElementType());
        addElementProcessor(new Errors());
        addElementProcessor(new ExcludeField());
        addElementProcessor(new Feedback());
        addElementProcessor(new FieldLabel());
        addElementProcessor(new FieldName());
        addElementProcessor(new FieldValue());
        addElementProcessor(new FormField());
        addElementProcessor(new FormEntry());
        addElementProcessor(new Forward());
        addElementProcessor(new GetField());
View Full Code Here

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.value.FieldName

        addElementProcessor(new EditObject());
        addElementProcessor(new ElementType());
        addElementProcessor(new ExcludeField());
        addElementProcessor(new Feedback());
        addElementProcessor(new FieldLabel());
        addElementProcessor(new FieldName());
        addElementProcessor(new FieldValue());
        addElementProcessor(new FormField());
        addElementProcessor(new FormEntry());
        addElementProcessor(new Forward());
        addElementProcessor(new GetField());
View Full Code Here

Examples of org.dmg.pmml.FieldName

    return this;
    }

  public PMMLPlanner addDataType( String name, Type type )
    {
    FieldName fieldName = new FieldName( name );

    if( getPMMLModel().getDataField( fieldName ) != null )
      throw new IllegalStateException( "field name already in dictionary" );

    DataType dataType = DataTypes.getTypeToPmml( type );
View Full Code Here

Examples of org.fest.reflect.field.FieldName

   * @return the starting point of the method chain.
   * @throws NullPointerException     if the given name is {@code null}.
   * @throws IllegalArgumentException if the given name is empty.
   */
  public static @Nonnull FieldName field(@Nonnull String name) {
    return new FieldName(name);
  }
View Full Code Here

Examples of org.openquark.cal.compiler.FieldName

            applicationExpressions[0] = SourceModel.Expr.Var.makeUnqualified(calConstructorName);

            Expr.Var unsafeCoerce = Expr.Var.make(CAL_Prelude.Functions.unsafeCoerce);
           
            for (int i = 0, n = dc.getArity(); i < n; ++i) {
                FieldName fn = dc.getNthFieldName(i);
               
                SourceModel.Expr argValue = Expr.SelectDataConsField.make(dcVar, dataConsSourceModelName, SourceModel.Name.Field.make(fn));
               
                // If the type of the dc field matches the type of the constructor argument
                // we can simply use the field accessor.  Otherwise we need to apply output to
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.