当前位置: 首页>>代码示例>>Java>>正文


Java ChameleonProgrammerException类代码示例

本文整理汇总了Java中org.aikodi.chameleon.exception.ChameleonProgrammerException的典型用法代码示例。如果您正苦于以下问题:Java ChameleonProgrammerException类的具体用法?Java ChameleonProgrammerException怎么用?Java ChameleonProgrammerException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChameleonProgrammerException类属于org.aikodi.chameleon.exception包,在下文中一共展示了ChameleonProgrammerException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addBoolean

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void addBoolean(String mm, DocumentScanner loader) {
	Public pub = new Public();
	Type booleanT = new PrimitiveType("boolean");
	booleanT.addModifier(pub);
	try {
		new DeclarationLoader(booleanT,mm,view(), loader);
	} catch (InputException e) {
		throw new ChameleonProgrammerException(e);
	}
	addPrefixOperator(booleanT, "boolean", "!");
	addInfixOperator(booleanT, "boolean", equality(), "boolean");
	addInfixOperator(booleanT, "boolean", "!=", "boolean");
	addInfixOperator(booleanT, "boolean", "&", "boolean");
	addInfixOperator(booleanT, "boolean", "|", "boolean");
	addInfixOperator(booleanT, "boolean", "^", "boolean");
	addInfixOperator(booleanT, "boolean", "||", "boolean");
	addInfixOperator(booleanT, "boolean", "&&", "boolean");
	addInfixOperator(booleanT, "boolean", "&=", "boolean");
	addInfixOperator(booleanT, "boolean", "|=", "boolean");
	addInfixOperator(booleanT, "boolean", "^=", "boolean");
	addStringConcatenation(booleanT);
	view().storePrimitiveType("boolean",booleanT);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:24,代码来源:PrimitiveTypeFactory.java

示例2: addDouble

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void addDouble(String mm, DocumentScanner loader) {
	Public pub = new Public();
	Type doubleT = new PrimitiveType("double");
	try {
		new DeclarationLoader(doubleT,mm,view(),loader);
	} catch (InputException e) {
		throw new ChameleonProgrammerException(e);
	}

	doubleT.addModifier(pub);
	doubleT.addModifier(new ValueType());

	addUniProm(doubleT);
	addBinNumOps(doubleT);
	addStringConcatenation(doubleT);
	addWrapperOperators(doubleT);
	view().storePrimitiveType("double",doubleT);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:19,代码来源:PrimitiveTypeFactory.java

示例3: addLong

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void addLong(String mm, DocumentScanner loader) {
	Public pub = new Public();

	Type longT = new PrimitiveType("long") {
		public boolean assignableTo(Type other) {
			return other.equals(this)
					|| other.getFullyQualifiedName().equals("float")
					|| other.getFullyQualifiedName().equals("double");
		}
	};
	try {
		new DeclarationLoader(longT,mm,view(),loader);
	} catch (InputException e) {
		throw new ChameleonProgrammerException(e);
	}
	longT.addInheritanceRelation(new SubtypeRelation(language().createTypeReference("float")));
	longT.addModifier(pub);
	longT.addModifier(new ValueType());

	addUniPromIntegral(longT);

	addBinNumOpsIntegral(longT);
	addStringConcatenation(longT);
	addWrapperOperators(longT);
	view().storePrimitiveType("long",longT);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:27,代码来源:PrimitiveTypeFactory.java

示例4: addFloat

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void addFloat(String mm, DocumentScanner loader) {
	Public pub = new Public();

	Type floatT = new PrimitiveType("float") {
		public boolean assignableTo(Type other) {
			return other.equals(this)
					|| other.getFullyQualifiedName().equals("double");
		}
	};
	try {
		new DeclarationLoader(floatT,mm,view(),loader);
	} catch (InputException e) {
		throw new ChameleonProgrammerException(e);
	}
	floatT.addInheritanceRelation(new SubtypeRelation(language().createTypeReference("double")));
	floatT.addModifier(pub);
	floatT.addModifier(new ValueType());

	addUniProm(floatT);

	addBinNumOps(floatT);
	addStringConcatenation(floatT);
	addWrapperOperators(floatT);
	view().storePrimitiveType("float",floatT);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:26,代码来源:PrimitiveTypeFactory.java

示例5: addVoid

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void addVoid(String mm, DocumentScanner loader) {
	Public pub = new Public();
	Type voidT = new PrimitiveType("void") {

		public boolean assignableTo(Type other) {
			return false;
		}

	}; // toevoeging gebeurt door de constructor
	try {
		new DeclarationLoader(voidT,mm,view(),loader);
	} catch (InputException e) {
		throw new ChameleonProgrammerException(e);
	}
	voidT.addModifier(pub);

	voidT.addModifier(new ValueType());
	view().storePrimitiveType("void",voidT);
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:20,代码来源:PrimitiveTypeFactory.java

示例6: actualType

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected Type actualType() throws LookupException {
  Element parent = parent();
if (parent instanceof ArrayCreationExpression) {
    return ((ArrayCreationExpression)parent).getType();
  }
  else if (parent instanceof ArrayInitializer) {
    Type type = ((ArrayInitializer)parent).getType();
	ArrayType temp = (ArrayType)type;
    return temp.elementType();
  }
  else if (parent instanceof Expression) {
    return ((Expression)parent).getType();
  }
  else if (parent instanceof Variable) {
    return ((Variable)parent).getType();
  }
  else if (parent instanceof JavaVariableDeclaration) {
  	return nearestAncestor(JavaVariableDeclaration.class).typeReference().getElement();
  }
  else {
    throw new ChameleonProgrammerException("Cannot determine type of array initializer based on the parent.");
  }
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:24,代码来源:ArrayInitializer.java

示例7: getElement

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
@Override
public NormalMethod getElement() throws LookupException {
	Type parent = nearestAncestor(Type.class);
	if(parent == null) {
		throw new ChameleonProgrammerException("The super constructor delegation is not inside a type.");
	}
	List<Type> types = parent.getProperDirectSuperTypes();
DeclarationCollector<NormalMethod> collector = new DeclarationCollector<NormalMethod>(selector());
	for(Type type: types) {
		type.targetContext().lookUp(collector);
		if(!collector.willProceed()) {
			return collector.result();
		}
	}
	throw new LookupException("No super constructor was found.");
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:17,代码来源:SuperConstructorDelegation.java

示例8: lci

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
private Type lci(Type first, Type second, Binder root) throws LookupException {
	Type result = first;
	if(first.nbTypeParameters(TypeParameter.class) > 0) {
		result = Util.clone(first);
		result.setUniParent(first.parent());
		List<TypeArgument> firstArguments = arguments(first);
		List<TypeArgument> secondArguments = arguments(second);
		int size = firstArguments.size();
		if(secondArguments.size() != size) {
			throw new ChameleonProgrammerException("The number of type parameters from the first list: "+size+" is different from the number of type parameters in the second list: "+secondArguments.size());
		}
		List<TypeParameter> newParameters = lcta(firstArguments, secondArguments,root);
		result.replaceAllParameters(TypeParameter.class,newParameters);
	}
	return result;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:17,代码来源:JavaSubtypingRelation.java

示例9: replaceSubobjectsOld

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void replaceSubobjectsOld(Document javaDocument) {
  javaDocument.apply(Subobject.class, javaSubobject -> {
    try {
      Type subobjectInterface = ooFactory(javaSubobject).createRegularType(subobjectInterfaceName(javaSubobject));
      Subobject jloSubobject = (Subobject) javaSubobject.origin();
      subobjectInterface.addModifier(new Interface());
      SubtypeRelation javaSubtypeRelation = new SubtypeRelation(clone(javaSubobject.superClassReference()));
      subobjectInterface.addInheritanceRelation(javaSubtypeRelation);
      Method getter = createSubobjectGetterTemplate(jloSubobject, java(javaSubobject));
      getter.addModifier(new Abstract());
      getter.addModifier(new Public());
      Type nearestAncestor = javaSubobject.nearestAncestor(Type.class);
      nearestAncestor.add(getter);
      applyToSortedTypeMemberDeclarators(jloSubobject.nearestAncestor(Type.class), m -> {
        subobjectInterface.addParameter(TypeParameter.class, clone(m.parameter()));
      });
      javaSubobject.replaceWith(subobjectInterface);
    } catch (LookupException e) {
      throw new ChameleonProgrammerException(e);
    }
  } );
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:23,代码来源:Java8InterfaceGenerator.java

示例10: implementOwnInterfaces

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void implementOwnInterfaces(Document javaDocument) {
	javaDocument.apply(Type.class, javaType -> {
		try {
			Java7 java = java(javaDocument);
			// Only disconnect inheritance relations that are explicit, and
			// that are no subobjects.
			if(!isGenerated(javaType)) {
				Type jloType = (Type) javaType.origin();
				javaType.explicitNonMemberInheritanceRelations().forEach(javaInheritanceRelation -> javaInheritanceRelation.disconnect());
				BasicJavaTypeReference superTypeReference = java.createTypeReference(javaType.name());
				SubtypeRelation relation = new SubtypeRelation(superTypeReference);
				relation.addModifier(new Implements());
				javaType.addInheritanceRelation(relation);
				addTypeParameters(relation,jloType);
				javaType.setName(implementationName(javaType));
				javaType.modifiers(java.SCOPE_MUTEX).forEach(m -> m.disconnect());
			}
		} catch (ModelException e) {
			throw new ChameleonProgrammerException(e);
		}
		javaType.addModifier(new Public());
	});
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:24,代码来源:Java8ClassGenerator.java

示例11: addFields

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
protected void addFields(Document javaDocument) {
	javaDocument.apply(MemberVariableDeclarator.class, javaMethod -> {
		if(! isGenerated(javaMethod)) {
			javaMethod.disconnect();
		}
	});
	javaDocument.apply(Type.class, t -> {
		if(! (t instanceof SubobjectType) && ! isGenerated(t)) {
			Type originalType = (Type) t.origin();
			try {
				addFields(t, originalType);
			} catch (Exception e) {
				throw new ChameleonProgrammerException(e);
			}
		} 
	});
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:18,代码来源:Java8ClassGenerator.java

示例12: clone

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
@Override
public LazyClassFileDocumentLoader clone() {
	try {
		return new LazyClassFileDocumentLoader(parser(),null,null);
	} catch (InputException e) {
		// Won't be connected, so no exception
		throw new ChameleonProgrammerException(e);
	}
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:10,代码来源:LazyClassFileDocumentLoader.java

示例13: clone

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
@Override
public DocumentLoaderImpl clone() {
	try {
		return new LazyReflectiveDocumentLoader(_loader, _parser, _fqn, null, null);
	} catch (InputException e) {
		throw new ChameleonProgrammerException(e);
	}
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:9,代码来源:LazyReflectiveDocumentLoader.java

示例14: ASMClassParser

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
public ASMClassParser(ZipFile file, ZipEntry entry, String className, String packageFQN) {
  if(className == null) {
    throw new ChameleonProgrammerException("The class name cannot be null.");
  }
  if(className.equals("")) {
    throw new ChameleonProgrammerException("The class name cannot be the empty string.");
  }
  _jarFile = file;
  _entry = entry;
  _name = className;
  _packageFQN = packageFQN;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:13,代码来源:ASMClassParser.java

示例15: visitTypeArgument

import org.aikodi.chameleon.exception.ChameleonProgrammerException; //导入依赖的package包/类
@Override
public SignatureVisitor visitTypeArgument(char kind) {
  // create visitor with 'this' as its parent.
  final TypeArgumentWithTypeReference arg;
  if(kind == SignatureVisitor.INSTANCEOF) {
    arg = _language.createEqualityTypeArgument(null);
  } else if(kind == SignatureVisitor.EXTENDS) {
    arg = _language.createExtendsWildcard(null);
  } else if(kind == SignatureVisitor.SUPER) {
    arg = _language.createSuperWildcard(null);
  } else {
    throw new ChameleonProgrammerException();
  }
  ((BasicJavaTypeReference)typeReference()).addArgument(arg);
  return new TypeReferenceExtractor(language()) {
    /**
     * If there is no bound, we replace the type argument with a pure wildcard.
     * I GUESS that ? is modeled as an EXTENDS bound without a type reference.
     */
    //FIXME Or is this method no invoked for ??
    @Override
    public void visitEnd() {
      if(this.typeReference() == null) {
        SingleAssociation parentLink = arg.parentLink();
        parentLink.getOtherRelation().replace(parentLink, new JavaPureWildcard().parentLink());
      }
    }
    protected void connect(TypeReference tref) {
      arg.setTypeReference(tref);
    }
  };
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:33,代码来源:ASMClassParser.java


注:本文中的org.aikodi.chameleon.exception.ChameleonProgrammerException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。