// Path: src/main/java/org/gwtproject/place/impl/AbstractPlaceHistoryMapper.java
// public abstract class AbstractPlaceHistoryMapper implements PlaceHistoryMapper {
// 
//   /** Return value for {@link AbstractPlaceHistoryMapper#getPrefixAndToken(Place)}. */
//   public static class PrefixAndToken {
//     public final String prefix;
//     public final String token;
// 
//     public PrefixAndToken(String prefix, String token) {
//       assert prefix != null && !prefix.contains(":");
//       this.prefix = prefix;
//       this.token = token;
//     }
// 
//     @Override
//     public String toString() {
//       return (prefix.length() == 0) ? token : prefix + ":" + token;
//     }
//   }
// 
//   @Override
//   public Place getPlace(String token) {
//     int colonAt = token.indexOf(':');
//     String initial;
//     String rest;
//     if (colonAt >= 0) {
//       initial = token.substring(0, colonAt);
//       rest = token.substring(colonAt + 1);
//     } else {
//       initial = "";
//       rest = token;
//     }
//     PlaceTokenizer<?> tokenizer = getTokenizer(initial);
//     if (tokenizer != null) {
//       return tokenizer.getPlace(rest);
//     }
//     return null;
//   }
// 
//   @Override
//   public String getToken(Place place) {
//     PrefixAndToken token = getPrefixAndToken(place);
//     if (token != null) {
//       return token.toString();
//     }
//     return null;
//   }
// 
//   /**
//    * Returns the token, or null.
//    *
//    * @param newPlace what needs tokenizing
//    */
//   protected abstract PrefixAndToken getPrefixAndToken(Place newPlace);
// 
//   /**
//    * Returns the {@link PlaceTokenizer} registered with that token, or null.
//    *
//    * @param prefix the prefix found on the history token
//    */
//   protected abstract PlaceTokenizer<?> getTokenizer(String prefix);
// }
// 
// Path: src/main/java/org/gwtproject/place/shared/PlaceTokenizer.java
// public interface PlaceTokenizer<P extends Place> {
// 
//   /**
//    * Returns the {@link Place} associated with the given token.
//    *
//    * @param token a String token
//    * @return a {@link Place} of type P
//    */
//   P getPlace(String token);
// 
//   /**
//    * Returns the token associated with the given {@link Place}.
//    *
//    * @param place a {@link Place} of type P
//    * @return a String token
//    */
//   String getToken(P place);
// }


import com.google.auto.common.BasicAnnotationProcessor.Step;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Sets;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeSpec;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collections;
import java.util.Set;
import javax.annotation.processing.Filer;
import javax.annotation.processing.Messager;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.util.ElementFilter;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;
import org.gwtproject.place.impl.AbstractPlaceHistoryMapper;
import org.gwtproject.place.shared.PlaceTokenizer;
import org.gwtproject.place.shared.WithFactory;
import org.gwtproject.place.shared.WithTokenizers;
/*
 * Copyright 2017 The GWT Project Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.gwtproject.place.processor;


class PlaceHistoryMapperProcessingStep implements Step {
  private static final ClassName PREFIX_AND_TOKEN_CLASS_NAME =
// Path: src/main/java/org/gwtproject/place/impl/AbstractPlaceHistoryMapper.java
// public abstract class AbstractPlaceHistoryMapper implements PlaceHistoryMapper {
// 
//   /** Return value for {@link AbstractPlaceHistoryMapper#getPrefixAndToken(Place)}. */
//   public static class PrefixAndToken {
//     public final String prefix;
//     public final String token;
// 
//     public PrefixAndToken(String prefix, String token) {
//       assert prefix != null && !prefix.contains(":");
//       this.prefix = prefix;
//       this.token = token;
//     }
// 
//     @Override
//     public String toString() {
//       return (prefix.length() == 0) ? token : prefix + ":" + token;
//     }
//   }
// 
//   @Override
//   public Place getPlace(String token) {
//     int colonAt = token.indexOf(':');
//     String initial;
//     String rest;
//     if (colonAt >= 0) {
//       initial = token.substring(0, colonAt);
//       rest = token.substring(colonAt + 1);
//     } else {
//       initial = "";
//       rest = token;
//     }
//     PlaceTokenizer<?> tokenizer = getTokenizer(initial);
//     if (tokenizer != null) {
//       return tokenizer.getPlace(rest);
//     }
//     return null;
//   }
// 
//   @Override
//   public String getToken(Place place) {
//     PrefixAndToken token = getPrefixAndToken(place);
//     if (token != null) {
//       return token.toString();
//     }
//     return null;
//   }
// 
//   /**
//    * Returns the token, or null.
//    *
//    * @param newPlace what needs tokenizing
//    */
//   protected abstract PrefixAndToken getPrefixAndToken(Place newPlace);
// 
//   /**
//    * Returns the {@link PlaceTokenizer} registered with that token, or null.
//    *
//    * @param prefix the prefix found on the history token
//    */
//   protected abstract PlaceTokenizer<?> getTokenizer(String prefix);
// }
// 
// Path: src/main/java/org/gwtproject/place/shared/PlaceTokenizer.java
// public interface PlaceTokenizer<P extends Place> {
// 
//   /**
//    * Returns the {@link Place} associated with the given token.
//    *
//    * @param token a String token
//    * @return a {@link Place} of type P
//    */
//   P getPlace(String token);
// 
//   /**
//    * Returns the token associated with the given {@link Place}.
//    *
//    * @param place a {@link Place} of type P
//    * @return a String token
//    */
//   String getToken(P place);
// }


// Path: processor/src/main/java/org/gwtproject/place/processor/PlaceHistoryMapperProcessingStep.java
import com.google.auto.common.BasicAnnotationProcessor.Step;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Sets;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeSpec;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collections;
import java.util.Set;
import javax.annotation.processing.Filer;
import javax.annotation.processing.Messager;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.util.ElementFilter;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.Diagnostic;
import org.gwtproject.place.impl.AbstractPlaceHistoryMapper;
import org.gwtproject.place.shared.PlaceTokenizer;
import org.gwtproject.place.shared.WithFactory;
import org.gwtproject.place.shared.WithTokenizers;

/*
 * Copyright 2017 The GWT Project Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.gwtproject.place.processor;


class PlaceHistoryMapperProcessingStep implements Step {
  private static final ClassName PREFIX_AND_TOKEN_CLASS_NAME =
      ClassName.get(AbstractPlaceHistoryMapper.PrefixAndToken.class);