FieldOutline
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.sun.tools.xjc.outline.FieldOutline(Showing top 20 results out of 315)

Refine search

  • JBlock
  • JExpr
  • CPropertyInfo
  • JDefinedClass
  • ClassOutline
  • JMethod
  • Common ways to obtain FieldOutline
private void myMethod () {
FieldOutline f =
  • FieldRenderer fieldRenderer;fieldRenderer.generate(context, prop)
  • Constructor function Object() { [native code] };(FieldOutline) function Object() { [native code] }.newInstance(new Object[]{context, prop})
  • ClassOutlineImpl outline;new ConstField(outline, prop)
  • AI code suggestions by Codota
}
origin: org.jvnet.jaxb2_commons/jaxb2-basics

  @Override
  public void generateSetter(FieldOutline fieldOutline,
      JDefinedClass theClass, JMethod setter, JVar value) {
    final JFieldVar field = theClass.fields().get(
        fieldOutline.getPropertyInfo().getName(false));
    if (field != null) {
      setter.body().assign(JExpr._this().ref(field), value);
    } else {
      // Fallback to the accessor
      Mode.accessor.generateSetter(fieldOutline, theClass,
          setter, value);
    }
  }
};
origin: com.sun.xml.bind/jaxb-xjc

public void toRawValue(JBlock block, JVar $var) {
  // [RESULT]
  // if([core.hasSetValue])
  //   $var = [core.toRawValue].getValue();
  // else
  //   $var = null;
  JConditional cond = block._if(acc.hasSetValue());
  JVar $v = cond._then().decl(core.getRawType(), "v" + hashCode());// TODO: unique value control
  acc.toRawValue(cond._then(),$v);
  cond._then().assign($var,$v.invoke("getValue"));
  cond._else().assign($var, JExpr._null());
}
origin: org.jvnet.jaxb2_commons/jaxb2-basics

  @Override
  public void generateSetter(FieldOutline fieldOutline,
      JDefinedClass theClass, JMethod setter, JVar value) {
    final FieldAccessor accessor = fieldOutline.create(JExpr
        ._this());
    accessor.unsetValues(setter.body());
    accessor.fromRawValue(setter.body()._if(value.ne(JExpr._null()))._then(), "draft", value);
  }
},
origin: jpmml/jpmml-model

  @Override
  public boolean accept(FieldOutline field){
    CPropertyInfo propertyInfo = field.getPropertyInfo();
    if(propertyInfo.isCollection()){
      JType elementType = CodeModelUtil.getElementType(field.getRawType());
      String name = elementType.name();
      return ((this.name).equals(name + "s") || (this.name).equals(JJavaName.getPluralForm(name)));
    }
    return false;
  }
};
origin: org.jvnet.jaxb2_commons/jaxb2-basics-annotate

@Override
public JAnnotatable getAnnotatable(Outline outline,
    FieldOutline fieldOutline) {
  return fieldOutline.parent().ref._package();
}
origin: org.apache.cxf.xjcplugins/cxf-xjc-dv

private boolean isAbstract(Outline outline, FieldOutline field) {
  for (ClassOutline classOutline : outline.getClasses()) {
    if (classOutline.implClass == field.getRawType() 
      && classOutline.implClass.isAbstract()) {
      return true;
    }
  }
  return false;
}

origin: org.jvnet.jaxb2_commons/jaxb2-basics-annotate

protected void processFieldOutline(ClassOutline classOutline,
    FieldOutline fieldOutline, Options options,
    ErrorHandler errorHandler) {
  final CCustomizations customizations = CustomizationUtils
      .getCustomizations(fieldOutline);
  annotate(fieldOutline.parent().ref.owner(), fieldOutline,
      customizations, errorHandler);
}
origin: org.jvnet.jaxb2_commons/jaxb2-basics-tools

public static String getPropertyName(FieldOutline fieldOutline) {
  return NameConverter.standard.toVariableName(fieldOutline
      .getPropertyInfo().getName(true));
}
origin: org.jvnet.jaxb2_commons/jaxb2-basics-tools

/**
 * Returns the <code>isSetProperty()</code> method for the given field
 * outline or <code>null</code> if no such method exists.
 * 
 * @param fieldOutline
 *            field outline.
 * @return The <code>isSetProperty()</code> method for the given field
 *         outline or <code>null</code> if no such method exists.
 */
public static JMethod issetter(FieldOutline fieldOutline) {
  final JDefinedClass theClass = fieldOutline.parent().implClass;
  final String publicName = fieldOutline.getPropertyInfo().getName(true);
  final String name = "isSet" + publicName;
  return theClass.getMethod(name, NONE);
}
origin: org.jvnet.jaxb2_commons/jaxb2-basics-tools

public void fromRawValue(JBlock block, String uniqueName,
    JExpression $var) {
  if (constantField != null) {
  } else if (setter != null) {
    block.invoke(targetObject, setter).arg($var);
  } else {
    unsetValues(block);
    if (fieldOutline.getPropertyInfo().isCollection()) {
      fieldAccessor.fromRawValue(block
          ._if($var.ne(JExpr._null()))._then(), uniqueName,
          $var);
    } else {
      fieldAccessor.fromRawValue(block, uniqueName, $var);
    }
  }
}
origin: jpmml/jpmml

static
public JFieldVar getFieldVar(FieldOutline field){
  ClassOutline clazz = field.parent();
  CPropertyInfo propertyInfo = field.getPropertyInfo();
  return (clazz.implClass.fields()).get(propertyInfo.getName(false));
}
origin: jpmml/jpmml

static
private FieldOutline getIdField(ClassOutline clazz){
  String name = "id";
  FieldOutline[] fields = clazz.getDeclaredFields();
  for(FieldOutline field : fields){
    CPropertyInfo propertyInfo = field.getPropertyInfo();
    String privateName = propertyInfo.getName(false);
    JType fieldType = field.getRawType();
    if((name).equals(privateName) && ("java.lang.String").equals(fieldType.fullName())){
      return field;
    }
  }
  return null;
}
origin: org.apache.cxf.xjcplugins/cxf-xjc-dv

private void updateDurationGetter(ClassOutline co, FieldOutline fo, JDefinedClass dc,
                 XmlString xmlDefaultValue, Outline outline) {
  String fieldName = fo.getPropertyInfo().getName(false);
  String getterName = "get" + fo.getPropertyInfo().getName(true);
  JMethod method = dc.getMethod(getterName, new JType[0]);
  JDocComment doc = method.javadoc();
  int mods = method.mods().getValue();
  JType mtype = method.type();
  if (LOG.isLoggable(Level.FINE)) {
    LOG.fine("Updating getter: " + getterName);
  }
  // remove existing method and define new one
  dc.methods().remove(method);
  method = dc.method(mods, mtype, getterName);
  method.javadoc().append(doc);
  JFieldRef fr = JExpr.ref(fieldName);
  if (xmlDefaultValue != null) {
    JExpression test = JOp.eq(JExpr._null(), fr);
    JConditional jc =  method.body()._if(test);
    JTryBlock b = jc._then()._try();
    b.body()._return(outline.getCodeModel().ref(DatatypeFactory.class)
      .staticInvoke("newInstance").invoke("newDuration").arg(JExpr.lit(xmlDefaultValue.value)));
    b._catch(outline.getCodeModel().ref(DatatypeConfigurationException.class));
    method.body()._return(fr);
  } else {
    method.body()._return(fr);
  }
}
origin: jpmml/jpmml

definedClazz._implements(hasIdInterface);
definedClazz._implements(hasExtensionsInterface);
CPropertyInfo propertyInfo = contentField.getPropertyInfo();
definedClazz._implements(iterableInterface.narrow(elementType));
JMethod iteratorMethod = definedClazz.method(JMod.PUBLIC, iteratorInterface.narrow(elementType), "iterator");
iteratorMethod.body()._return(JExpr.invoke("get" + propertyInfo.getName(true)).invoke("iterator"));
origin: org.jvnet.jaxb2_commons/jaxb2-basics-tools

public static Set<JType> getPossibleTypes(FieldOutline fieldOutline,
    Aspect aspect) {
  Validate.notNull(fieldOutline);
  final ClassOutline classOutline = fieldOutline.parent();
  final Outline outline = classOutline.parent();
  final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo();
  final Set<JType> types = new HashSet<JType>();
  if (propertyInfo.getAdapter() != null) {
    types.add(propertyInfo.getAdapter().customType.toType(fieldOutline
        .parent().parent(), aspect));
  } else if (propertyInfo.baseType != null) {
    types.add(propertyInfo.baseType);
  } else {
    Collection<? extends CTypeInfo> typeInfos = propertyInfo.ref();
    for (CTypeInfo typeInfo : typeInfos) {
      types.addAll(getPossibleTypes(outline, aspect, typeInfo));
    }
  }
  return types;
}
origin: com.sun.xml.bind/jaxb-xjc

buf.append(cls.name());
Iterator itr = cls._implements();
while(itr.hasNext()) {
  if(first) {
for( FieldOutline fo : ci.getDeclaredFields() ) {
  String type = printName(fo.getRawType());
  println(type+' '+fo.getPropertyInfo().getName(true)+';');
origin: com.sun.xml.bind/jaxb-xjc

private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
  // add isSetXXX and unsetXXX.
  MethodWriter writer = outline.createMethodWriter();
  
  JCodeModel codeModel = outline.parent().getCodeModel();
  
  FieldAccessor acc = core.create(JExpr._this());
  
  if( generateIsSetMethod ) {
    // [RESULT] boolean isSetXXX()
    JExpression hasSetValue = acc.hasSetValue();
    if( hasSetValue==null ) {
      // this field renderer doesn't support the isSet/unset methods generation.
      // issue an error
      throw new UnsupportedOperationException();
    }
    writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
      .body()._return( hasSetValue );
  }
  
  if( generateUnSetMethod ) {
    // [RESULT] void unsetXXX()
    acc.unsetValues(
      writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
  }
}
origin: org.jvnet.jaxb2_commons/jaxb2-basics-tools

/**
 * Returns the <code>setProperty(...)</code> method for the given field
 * outline or <code>null</code> if no such method exists.
 * 
 * @param fieldOutline
 *            field outline.
 * @return The <code>setProperty(...)</code> method for the given field
 *         outline or <code>null</code> if no such method exists.
 */
public static JMethod setter(FieldOutline fieldOutline) {
  final JMethod getter = getter(fieldOutline);
  final JType type = getter != null ? getter.type() : fieldOutline
      .getRawType();
  final JDefinedClass theClass = fieldOutline.parent().implClass;
  final String publicName = fieldOutline.getPropertyInfo().getName(true);
  final String name = "set" + publicName;
  return theClass.getMethod(name, new JType[] { type });
}
origin: org.jvnet.jaxb2_commons/jaxb2-basics

protected JMethod generateToString$appendFields(ClassOutline classOutline,
    final JDefinedClass theClass) {
  final JCodeModel codeModel = theClass.owner();
  final JMethod toString$appendFields = theClass.method(JMod.PUBLIC,
      codeModel.ref(StringBuilder.class), "appendFields");
      body.invoke(JExpr._super(), "appendFields").arg(locator)
          .arg(buffer).arg(toStringStrategy);
    } else {
        classOutline.getDeclaredFields(), getIgnoring());
        final JBlock block = body.block();
        final FieldAccessorEx fieldAccessor = getFieldAccessorFactory()
            .createFieldAccessor(fieldOutline, JExpr._this());
        final JVar theValue = block.decl(
            fieldAccessor.getType(),
            "the"
                + fieldOutline.getPropertyInfo().getName(
                    true));
        block.invoke(toStringStrategy, "appendField")
            .arg(locator)
            .arg(JExpr._this())
            .arg(JExpr.lit(fieldOutline.getPropertyInfo()
                .getName(false))).arg(buffer).arg(theValue)
            .arg(valueIsSet);
origin: org.apache.cxf.xjcplugins/cxf-xjc-dv

String fieldName = fo.getPropertyInfo().getName(false);
JType type = fo.getRawType();
String typeName = type.fullName();
          + fo.getPropertyInfo().getName(true);
JMethod method = dc.getMethod(getterName, new JType[0]);
JType mtype = method.type();
String setterName = "set" + fo.getPropertyInfo().getName(true);
method = dc.getMethod(setterName, new JType[] {mtype});
if (LOG.isLoggable(Level.FINE)) {
  LOG.fine("Updating setter: " + setterName);
  return;
JDocComment doc = method.javadoc();
dc.methods().remove(method);
JMethod oldMethod = dc.getMethod("unset" + fo.getPropertyInfo().getName(true), new JType[0]);
if (oldMethod != null) {
  dc.methods().remove(oldMethod);
method = dc.method(mods, method.type(), "unset" + fo.getPropertyInfo().getName(true));
method.body().assign(fr, JExpr._null());
method = dc.getMethod("isSet" + fo.getPropertyInfo().getName(true), new JType[0]);
if (method != null) {
com.sun.tools.xjc.outlineFieldOutline

Javadoc

Representation of a field of ClassOutline.

Most used methods

  • getPropertyInfo
    Gets the corresponding model object.
  • getRawType
    Gets the type of the "raw value". This type can represent the entire value of this field. For fields
  • parent
    Gets the enclosing ClassOutline.
  • create
    Creates a new FieldAccessor of this field for the specified object.

Popular classes and methods

  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JButton (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)