本文整理汇总了Java中com.sun.tools.xjc.outline.Outline类的典型用法代码示例。如果您正苦于以下问题:Java Outline类的具体用法?Java Outline怎么用?Java Outline使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Outline类属于com.sun.tools.xjc.outline包,在下文中一共展示了Outline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options options, ErrorHandler errorHandler) {
// for each generated classes
for (ClassOutline generatedClassOutline : outline.getClasses()) {
JDefinedClass generatedClass = generatedClassOutline.implClass;
if (!isAbstractClass(generatedClass) &&
!generatedClass.fields().isEmpty()) {
boolean commandExecuted = false;
for (Command command : commands.values()) {
if (command.isEnabled()) {
command.editGeneratedClass(generatedClass);
commandExecuted = true;
}
}
if (!commandExecuted) {
defaultCommand.editGeneratedClass(generatedClass);
}
}
}
return true;
}
示例2: run
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws Exception {
PluginImpl clonePlugin = new PluginImpl();
clonePlugin.run(outline, opt, errorHandler);
Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet();
for (Map.Entry<NClass, CClassInfo> entry : set) {
ClassOutline classOutline = outline.getClazz(entry.getValue());
if (isPrism(classOutline)) {
removeConstructors(classOutline);
removeCloneableMethod(classOutline);
removePrivateStaticCopyMethods(classOutline);
createCloneMethod(classOutline);
}
}
return true;
}
示例3: removeCustomGeneratedMethod
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
/**
* remove generated equals methods from classes which extends from prism containers/objects
*/
private void removeCustomGeneratedMethod(Outline outline) {
Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet();
for (Map.Entry<NClass, CClassInfo> entry : set) {
ClassOutline classOutline = outline.getClazz(entry.getValue());
QName qname = getCClassInfoQName(entry.getValue());
if (qname == null || (!hasParentAnnotation(classOutline, A_PRISM_OBJECT)
&& !hasParentAnnotation(classOutline, A_PRISM_CONTAINER))) {
continue;
}
JDefinedClass definedClass = classOutline.implClass;
Iterator<JClass> iterator = definedClass._implements();
while (iterator.hasNext()) {
JClass clazz = iterator.next();
if (clazz.equals(CLASS_MAP.get(Equals.class)) || clazz.equals(CLASS_MAP.get(HashCode.class))) {
iterator.remove();
}
}
boolean isMidpointContainer = hasParentAnnotation(classOutline, A_PRISM_OBJECT);
removeOldCustomGeneratedEquals(classOutline, isMidpointContainer);
removeOldCustomGenerated(classOutline, isMidpointContainer, METHOD_HASH_CODE);
removeOldCustomGenerated(classOutline, isMidpointContainer, METHOD_TO_STRING);
}
}
示例4: addComplextType
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
private void addComplextType(Outline outline, Map<String, JFieldVar> namespaceFields) {
Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet();
for (Map.Entry<NClass, CClassInfo> entry : set) {
ClassOutline classOutline = outline.getClazz(entry.getValue());
QName qname = entry.getValue().getTypeName();
if (qname == null) {
continue;
}
JFieldVar var = namespaceFields.get(qname.getNamespaceURI());
if (var != null) {
createQNameDefinition(outline, classOutline.implClass, COMPLEX_TYPE_FIELD_NAME, var, qname);
} else {
createPSFField(outline, classOutline.implClass, COMPLEX_TYPE_FIELD_NAME, qname);
}
}
}
示例5: AbstractSinglePropertyOutline
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public AbstractSinglePropertyOutline(Outline outline,
MClassOutline classOutline, MPropertyInfo<NType, NClass> target) {
super(outline, classOutline, target);
this.field = generateField();
this.getter = generateGetter();
this.setter = generateSetter();
}
示例6: AbstractPropertyOutline
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public AbstractPropertyOutline(Outline outline, MClassOutline classOutline,
MPropertyInfo<NType, NClass> target) {
Validate.notNull(outline);
Validate.notNull(classOutline);
Validate.notNull(target);
this.outline = outline;
this.modelOutline = classOutline.getParent();
this.classOutline = classOutline;
this.propertyInfo = target;
this.codeModel = classOutline.getParent().getCode();
this.referenceClass = classOutline.getReferenceCode();
this.implementationClass = classOutline.getImplementationCode();
this.implementationReferenceClass = classOutline
.getImplementationReferenceCode();
this.type = generateType();
}
示例7: getClazz
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
protected NClass getClazz(final Class<?> _clas) {
return new NClass() {
@Override
public boolean isBoxedType() {
return false;
}
@Override
public String fullName() {
return _clas.getName();
}
@Override
public JClass toType(Outline o, Aspect aspect) {
return o.getCodeModel().ref(_clas);
}
@Override
public boolean isAbstract() {
return false;
}
};
}
示例8: createListType
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
protected NType createListType(final NType elementType) {
return new NClass() {
public boolean isBoxedType() {
return false;
}
public String fullName() {
return List.class.getName();
}
public JClass toType(Outline o, Aspect aspect) {
return o.getCodeModel().ref(List.class)
.narrow(elementType.toType(o, aspect).boxify());
}
public boolean isAbstract() {
return false;
}
};
}
示例9: getPossibleTypes
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public static Set<JType> getPossibleTypes(Outline outline, Aspect aspect,
CTypeInfo typeInfo) {
final Set<JType> types = new HashSet<JType>();
types.add(typeInfo.getType().toType(outline, aspect));
if (typeInfo instanceof CElementInfo) {
final CElementInfo elementInfo = (CElementInfo) typeInfo;
for (CElementInfo substitutionMember : elementInfo
.getSubstitutionMembers()) {
types.addAll(getPossibleTypes(outline, aspect,
substitutionMember));
}
}
return types;
}
示例10: generateCode
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
protected Outline generateCode(final Model model)
throws MojoExecutionException {
if (getVerbose()) {
getLog().info("Compiling input schema(s)...");
}
final Outline outline = model.generateCode(model.options,
new LoggingErrorReceiver("Error while generating code.",
getLog(), getVerbose()));
if (outline == null) {
throw new MojoExecutionException(
"Failed to compile input schema(s)! Error messages should have been provided.");
} else {
return outline;
}
}
示例11: run
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {
for (final PackageOutline packageOutline : outline
.getAllPackageContexts()) {
final StringBuilder sb = new StringBuilder();
for (final ClassOutline classOutline : packageOutline.getClasses()) {
sb.append(CodeModelUtils.getLocalClassName(classOutline.ref));
sb.append("\n");
}
final JTextFile indexFile = new JTextFile("jaxb.index");
indexFile.setContents(sb.toString());
packageOutline._package().addResourceFile(indexFile);
}
return true;
}
示例12: run
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
@Override
public boolean run(final Outline outline, final Options opt, final ErrorHandler errorHandler) throws SAXException {
final PluginContext pluginContext = PluginContext.get(outline, opt, errorHandler);
if (this.extended && this.generateTools) {
pluginContext.writeSourceFile(PropertyInfo.class);
pluginContext.writeSourceFile(SinglePropertyInfo.class);
pluginContext.writeSourceFile(CollectionPropertyInfo.class);
pluginContext.writeSourceFile(IndirectCollectionPropertyInfo.class);
pluginContext.writeSourceFile(IndirectPrimitiveCollectionPropertyInfo.class);
pluginContext.writeSourceFile(PropertyVisitor.class);
pluginContext.writeSourceFile(Property.class);
pluginContext.writeSourceFile(SingleProperty.class);
pluginContext.writeSourceFile(CollectionProperty.class);
pluginContext.writeSourceFile(IndirectCollectionProperty.class);
pluginContext.writeSourceFile(IndirectPrimitiveCollectionProperty.class);
pluginContext.writeSourceFile(ItemProperty.class);
}
for (final ClassOutline classOutline : outline.getClasses()) {
generateMetaClass(pluginContext, classOutline, errorHandler);
}
return true;
}
示例13: generateCode
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
protected Outline generateCode(final Model model)
throws MojoExecutionException {
if (getVerbose()) {
getLog().info("Compiling input schema(s)...");
}
final Outline outline = model.generateCode(model.options,
new LoggingErrorReceiver("Error while generating code.",
getLog(), getVerbose()));
if (outline == null) {
throw new MojoExecutionException(
"Failed to compile input schema(s)! Error messages should have been provided.");
} else {
return outline;
}
}
示例14: process
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public Collection<ClassOutline> process(EjbPlugin context, Outline outline,
Options options) throws Exception {
logger.debug("Processing outline with context path ["
+ OutlineUtils.getContextPath(outline) + "].");
final Collection<? extends ClassOutline> classes = outline.getClasses();
final Collection<ClassOutline> processedClassOutlines = new ArrayList<ClassOutline>(
classes.size());
for (final ClassOutline classOutline : classes) {
if (!getIgnoring()
.isClassOutlineIgnored(getMapping(), classOutline)) {
final ClassOutline processedClassOutline = process(this,
classOutline, options);
if (processedClassOutline != null) {
processedClassOutlines.add(processedClassOutline);
}
}
}
return processedClassOutlines;
}
示例15: getPersistenceUnitName
import com.sun.tools.xjc.outline.Outline; //导入依赖的package包/类
public String getPersistenceUnitName(Mapping context, Outline outline) {
final StringBuffer sb = new StringBuffer();
boolean first = true;
for (final Iterator<? extends PackageOutline> packageOutlines = outline
.getAllPackageContexts().iterator(); packageOutlines.hasNext();) {
final PackageOutline packageOutline = packageOutlines.next();
if (!getIgnoring().isPackageOutlineIgnored(context, outline,
packageOutline)) {
if (!first) {
sb.append(':');
} else {
first = false;
}
final String packageName = packageOutline._package().name();
sb.append(packageName);
}
}
return sb.toString();
}