All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Search JAR files by class name

Source code of the class part of aspectjweaver version 1.8.9

Go to download Show more of this group Show artifacts with the name aspectjweaver
        /* *******************************************************************
 * Copyright (c) 2010 Contributors
 * All rights reserved. 
 * This program and the accompanying materials are made available 
 * under the terms of the Eclipse Public License v1.0 
 * which accompanies this distribution and is available at 
 * Contributors: 
 *     Andy Clement - SpringSource
 * ******************************************************************/
package org.aspectj.weaver.patterns;


import org.aspectj.weaver.BCException;
import org.aspectj.weaver.CompressingDataOutputStream;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.VersionedDataInputStream;

 * Implements common functions to be used across ISignaturePatterns.
 * @author Andy Clement
 * @since 1.6.9
public abstract class AbstractSignaturePattern implements ISignaturePattern {

	protected void writePlaceholderLocation(CompressingDataOutputStream s) throws IOException {

	public static ISignaturePattern readCompoundSignaturePattern(VersionedDataInputStream s, ISourceContext context)
			throws IOException {
		byte key = s.readByte();
		switch (key) {
		case PATTERN:
			return, context);
		case AND:
			return AndSignaturePattern.readAndSignaturePattern(s, context);
		case OR:
			return OrSignaturePattern.readOrSignaturePattern(s, context);
		case NOT:
			return NotSignaturePattern.readNotSignaturePattern(s, context);
			throw new BCException("unknown SignatureTypePattern kind: " + key);

	public static void writeCompoundSignaturePattern(CompressingDataOutputStream s, ISignaturePattern sigPattern)
			throws IOException {
		if (sigPattern instanceof SignaturePattern) {
			((SignaturePattern) sigPattern).write(s);
		} else if (sigPattern instanceof AndSignaturePattern) {
			AndSignaturePattern andSignaturePattern = (AndSignaturePattern) sigPattern;
			writeCompoundSignaturePattern(s, andSignaturePattern.getLeft());
			writeCompoundSignaturePattern(s, andSignaturePattern.getRight());
			s.writeInt(0); // TODO positions not yet set properly
		} else if (sigPattern instanceof OrSignaturePattern) {
			OrSignaturePattern orSignaturePattern = (OrSignaturePattern) sigPattern;
			writeCompoundSignaturePattern(s, orSignaturePattern.getLeft());
			writeCompoundSignaturePattern(s, orSignaturePattern.getRight());
			s.writeInt(0); // TODO positions not yet set properly
		} else {
			// negated
			NotSignaturePattern notSignaturePattern = (NotSignaturePattern) sigPattern;
			writeCompoundSignaturePattern(s, notSignaturePattern.getNegated());
			s.writeInt(0); // TODO positions not yet set properly

© 2018 Weber Informatics LLC