public String binaryName() { return componentType.binaryName()+"[]"; }
public String binaryName() { return componentType.binaryName()+"[]"; }
public String binaryName() { return componentType.binaryName()+"[]"; }
public String binaryName() { return componentType.binaryName()+"[]"; }
public String binaryName() { return componentType.binaryName()+"[]"; }
@Nonnull public static String removeWildcard( @Nonnull JType classWithWildcard, boolean returnBinaryName ) { if ( classWithWildcard != classWithWildcard.erasure() ) { throw new IllegalArgumentException( "Invalid type - cannot remove wildcard. Call erasure() first: " + classWithWildcard.fullName() ); } if ( classWithWildcard.fullName().contains( "?" ) ) { String fullName = returnBinaryName ? classWithWildcard.binaryName() : classWithWildcard.fullName(); Iterable<String> parts = Splitter.on( " " ).split( fullName ); String last = null; for ( String part : parts ) { last = part; } assert last != null; return last; } return returnBinaryName ? classWithWildcard.binaryName() : classWithWildcard.fullName(); }
public int compare( final CTypeInfo o1, final CTypeInfo o2 ) { final JType javaType1 = o1.toType( this.outline, Aspect.IMPLEMENTATION ); final JType javaType2 = o2.toType( this.outline, Aspect.IMPLEMENTATION ); int ret = 0; if ( !javaType1.binaryName().equals( javaType2.binaryName() ) && javaType1 instanceof JClass && javaType2 instanceof JClass ) { if ( ( (JClass) javaType1 ).isAssignableFrom( (JClass) javaType2 ) ) { ret = -1; } else if ( ( (JClass) javaType2 ).isAssignableFrom( (JClass) javaType1 ) ) { ret = 1; } } return ret; }
String type = jf.type().binaryName(); if (type.equals("java.lang.String")) { jf.init(JExpr.lit(value));
private JExpression getElementCopyExpression( final FieldOutline fieldOutline, final CElementInfo type, final JBlock block, final JExpression sourceExpr ) { block.directStatement( "// CElementInfo: " + type.toType( fieldOutline.parent().parent(), Aspect.IMPLEMENTATION ).binaryName() ); return this.getCopyOfElementInfoInvocation( fieldOutline, type ).arg( sourceExpr ); }
private BuilderOutline getReferencedBuilderOutline(final JType type) { BuilderOutline builderOutline = null; if (this.pluginContext.getClassOutline(type) == null && this.pluginContext.getEnumOutline(type) == null && type.isReference() && !type.isPrimitive() && !type.isArray() && type.fullName().contains(".")) { final Class<?> runtimeParentClass; try { runtimeParentClass = Class.forName(type.binaryName()); } catch (final ClassNotFoundException e) { return null; } final JClass builderClass = reflectRuntimeInnerClass(runtimeParentClass, this.settings.getBuilderClassName()); if (builderClass != null) { final ReferencedClassOutline referencedClassOutline = new ReferencedClassOutline(this.pluginContext.codeModel, runtimeParentClass); builderOutline = new BuilderOutline(referencedClassOutline, builderClass); } } return builderOutline; }
private JExpression getAdapterInfoCopyExpression( final FieldOutline fieldOutline, final CAdapterInfo type, final JBlock block, final JExpression source ) { block.directStatement( "// CAdapterInfo: " + type.toType( fieldOutline.parent().parent(), Aspect.IMPLEMENTATION ).binaryName() ); final JType jType = type.toType( fieldOutline.parent().parent(), Aspect.IMPLEMENTATION ); return JExpr.cast( jType, this.getCopyOfObjectInvocation( fieldOutline.parent() ).arg( source ) ); }
private JExpression getNonElementCopyExpression( final FieldOutline fieldOutline, final CNonElement type, final JBlock block, final JExpression sourceExpr, final boolean sourceMaybeNull ) { final JType jType = type.toType( fieldOutline.parent().parent(), Aspect.IMPLEMENTATION ); block.directStatement( "// CNonElement: " + jType.binaryName() ); block.directStatement( "// " + WARNING_PREFIX + ": " + "The '" + jType.binaryName() + "'" ); block.directStatement( "// " + WARNING_PREFIX + ": type was not part of the compilation unit." ); block.directStatement( "// " + WARNING_PREFIX + ": " + "The CC-XJC plugin assumes that type to declare a 'public Object clone()' method." ); block.directStatement( "// " + WARNING_PREFIX + ": " + "If this warning is part of an 'if instanceof' block, the order of 'if instanceof'" ); block.directStatement( "// " + WARNING_PREFIX + ": " + "statements may be wrong and must be verified." ); this.log( Level.WARNING, "nonElementWarning", fieldOutline.parent().implClass.fullName(), fieldOutline.getPropertyInfo().getName( true ), jType.binaryName(), WARNING_PREFIX ); this.tryCatchCopyExpression = true; if ( sourceMaybeNull ) { return JOp.cond( sourceExpr.eq( JExpr._null() ), JExpr._null(), JExpr.cast( jType, sourceExpr.invoke( "clone" ) ) ); } else { return JExpr.cast( jType, sourceExpr.invoke( "clone" ) ); } }
private JExpression getWildcardCopyExpression( final FieldOutline fieldOutline, final CWildcardTypeInfo type, final JBlock block, final JExpression sourceExpr, final boolean sourceMaybeNull ) { block.directStatement( "// CWildcardTypeInfo: " + type.toType( fieldOutline.parent().parent(), Aspect.IMPLEMENTATION ).binaryName() ); if ( sourceMaybeNull ) { return JOp.cond( sourceExpr.eq( JExpr._null() ), JExpr._null(), JExpr.cast( fieldOutline.parent().parent().getCodeModel().ref( Element.class ), sourceExpr.invoke( "cloneNode" ).arg( JExpr.TRUE ) ) ); } else { return JExpr.cast( fieldOutline.parent().parent().getCodeModel().ref( Element.class ), sourceExpr.invoke( "cloneNode" ).arg( JExpr.TRUE ) ); } }
Aspect.IMPLEMENTATION ).binaryName() );
"Creates and returns a deep copy of a given {@code " + arrayType.binaryName() + "} instance." );
m.javadoc().append( "Creates and returns a deep copy of a given {@code " + elementType.binaryName() + "} instance." );